Date: Sat, 24 Jul 2004 09:24:03 GMT From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 58031 for review Message-ID: <200407240924.i6O9O3Xf085127@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=58031 Change 58031 by julian@julian_ref on 2004/07/24 09:23:10 Simplify spare allocation a bit. We don't need that second argumant. Affected files ... .. //depot/projects/nsched/sys/kern/kern_kse.c#20 edit Differences ... ==== //depot/projects/nsched/sys/kern/kern_kse.c#20 (text+ko) ==== @@ -66,7 +66,7 @@ TAILQ_HEAD_INITIALIZER(zombie_upcalls); static int thread_update_usr_ticks(struct thread *td, int user); -static void thread_alloc_spare(struct thread *td, struct thread *spare); +static void thread_alloc_spare(struct thread *td); struct kse_upcall * upcall_alloc(void) @@ -576,7 +576,7 @@ /* For the first call this may not have been set */ if (td->td_standin == NULL) - thread_alloc_spare(td, NULL); + thread_alloc_spare(td); PROC_LOCK(p); if (newkg->kg_numupcalls >= ncpus) { @@ -894,17 +894,12 @@ * for thread_schedule_upcall(). */ void -thread_alloc_spare(struct thread *td, struct thread *spare) +thread_alloc_spare(struct thread *td) { - if (td->td_standin) return; - if (spare == NULL) { - spare = thread_alloc(); - } - sched_init_thread(spare); - td->td_standin = spare; - bzero(&spare->td_startzero, + td->td_standin = thread_alloc(); + bzero(&td->td_spare->td_startzero, (unsigned)RANGEOF(struct thread, td_startzero, td_endzero)); spare->td_proc = td->td_proc; spare->td_ucred = crhold(td->td_ucred); @@ -1061,7 +1056,7 @@ td->td_mailbox = NULL; } else { if (td->td_standin == NULL) - thread_alloc_spare(td, NULL); + thread_alloc_spare(td); flags = fuword32(&tmbx->tm_flags); /* * On some architectures, TP register points to thread @@ -1288,7 +1283,7 @@ * for when we re-enter the kernel. */ if (td->td_standin == NULL) - thread_alloc_spare(td, NULL); + thread_alloc_spare(td); } ku->ku_mflags = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407240924.i6O9O3Xf085127>