Date: Thu, 16 May 2002 16:12:22 -0700 (PDT) From: Jonathan Mini <mini@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 11412 for review Message-ID: <200205162312.g4GNCM759787@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11412 Change 11412 by mini@mini_stylus on 2002/05/16 16:11:57 Properly indent my last changes. Affected files ... ... //depot/projects/kse/sys/kern/kern_exit.c#47 edit ... //depot/projects/kse/sys/kern/kern_synch.c#60 edit ... //depot/projects/kse/sys/kern/kern_thread.c#47 edit ... //depot/projects/kse/sys/kern/subr_pcpu.c#8 edit ... //depot/projects/kse/sys/kern/subr_trap.c#54 edit ... //depot/projects/kse/sys/sys/pcpu.h#12 edit ... //depot/projects/kse/sys/sys/proc.h#99 edit Differences ... ==== //depot/projects/kse/sys/kern/kern_exit.c#47 (text+ko) ==== @@ -700,7 +700,7 @@ /* Free the KSE spare thread */ if (p->p_kse.ke_tdspare != NULL) - thread_free(p->p_kse.ke_tdspare); + thread_free(p->p_kse.ke_tdspare); /* * Give vm and machine-dependent layer a chance ==== //depot/projects/kse/sys/kern/kern_synch.c#60 (text+ko) ==== ==== //depot/projects/kse/sys/kern/kern_thread.c#47 (text+ko) ==== @@ -90,8 +90,8 @@ (unsigned)RANGEOF(struct thread, td_startzero, td_endzero)); td->td_state = TDS_NEW; td->td_flags |= TDF_UNBOUND; - cached_threads--; /* XXXSMP */ - active_threads++; /* XXXSMP */ + cached_threads--; /* XXXSMP */ + active_threads++; /* XXXSMP */ } /* @@ -118,7 +118,7 @@ * these states, because it is currently active. */ panic("bad state for thread unlinking"); - break; + /* NOTREACHED */ case TDS_UNQUEUED: case TDS_NEW: case TDS_RUNNING: @@ -126,12 +126,13 @@ break; default: panic("bad thread state"); + /* NOTREACHED */ } #endif /* Update counters. */ - active_threads--; /* XXXSMP */ - cached_threads++; /* XXXSMP */ + active_threads--; /* XXXSMP */ + cached_threads++; /* XXXSMP */ } /* @@ -186,28 +187,29 @@ /* Reassign this thread's KSE. */ if (ke != NULL) { - ke->ke_thread = NULL; - td->td_kse = NULL; - ke->ke_state = KES_UNQUEUED; - kse_reassign(ke); + ke->ke_thread = NULL; + td->td_kse = NULL; + ke->ke_state = KES_UNQUEUED; + kse_reassign(ke); } /* Unlink this thread from its proc. */ if (p != NULL) { - TAILQ_REMOVE(&p->p_threads, td, td_plist); - if (kg != NULL) - TAILQ_REMOVE(&kg->kg_threads, td, td_kglist); - p->p_numthreads--; - if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { - if (p->p_numthreads == - ((p->p_flag & P_SINGLE_EXIT) ? 1 : (p->p_suspcount + 1))) { - setrunqueue(p->p_singlethread); - p->p_singlethread = NULL; + TAILQ_REMOVE(&p->p_threads, td, td_plist); + if (kg != NULL) + TAILQ_REMOVE(&kg->kg_threads, td, td_kglist); + p->p_numthreads--; + if (P_SHOULDSTOP(p) == P_STOPPED_SNGL) { + if (p->p_numthreads == + ((p->p_flag & P_SINGLE_EXIT) ? 1 : + (p->p_suspcount + 1))) { + setrunqueue(p->p_singlethread); + p->p_singlethread = NULL; + } } - } } if (kg != NULL) - kg->kg_numthreads--; + kg->kg_numthreads--; td->td_state = TDS_SURPLUS; td->td_proc = NULL; td->td_ksegrp = NULL; @@ -292,16 +294,17 @@ KASSERT(!mtx_owned(&Giant), ("dying thread owns giant")); if (ke->ke_tdspare != NULL) { - mtx_unlock_spin(&sched_lock); - mtx_lock(&Giant); - thread_free(ke->ke_tdspare); - mtx_unlock(&Giant); - mtx_lock_spin(&sched_lock); + mtx_unlock_spin(&sched_lock); + mtx_lock(&Giant); + thread_free(ke->ke_tdspare); + mtx_unlock(&Giant); + mtx_lock_spin(&sched_lock); } cpu_thread_exit(td); /* XXXSMP */ thread_unlink(td); ke->ke_tdspare = td; cpu_throw(); + /* NOTREACHED */ } /* @@ -339,12 +342,12 @@ mtx_assert(&sched_lock, MA_OWNED); if (ke->ke_tdspare != NULL) { - td2 = ke->ke_tdspare; - ke->ke_tdspare = NULL; + td2 = ke->ke_tdspare; + ke->ke_tdspare = NULL; } else { - mtx_unlock_spin(&sched_lock); - td2 = thread_alloc(); - mtx_lock_spin(&sched_lock); + mtx_unlock_spin(&sched_lock); + td2 = thread_alloc(); + mtx_lock_spin(&sched_lock); } CTR3(KTR_PROC, "thread_schedule_upcall: thread %p (pid %d, %s)", td, td->td_proc->p_pid, td->td_proc->p_comm); ==== //depot/projects/kse/sys/kern/subr_pcpu.c#8 (text+ko) ==== ==== //depot/projects/kse/sys/kern/subr_trap.c#54 (text+ko) ==== @@ -117,14 +117,14 @@ * due to a single threading requirement. */ if (p->p_flag & P_KSES) { - PROC_LOCK(p); - thread_suspend_check(0); /* Can suspend or kill */ - PROC_UNLOCK(p); - if (ke->ke_tdspare == NULL) { - mtx_lock(&Giant); - ke->ke_tdspare = thread_alloc(); - mtx_unlock(&Giant); - } + PROC_LOCK(p); + thread_suspend_check(0); /* Can suspend or kill */ + PROC_UNLOCK(p); + if (ke->ke_tdspare == NULL) { + mtx_lock(&Giant); + ke->ke_tdspare = thread_alloc(); + mtx_unlock(&Giant); + } } if (td->td_flags & TDF_UNBOUND) { /* maybe this should be in a separate function */ ==== //depot/projects/kse/sys/sys/pcpu.h#12 (text+ko) ==== ==== //depot/projects/kse/sys/sys/proc.h#99 (text+ko) ==== To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200205162312.g4GNCM759787>