From owner-p4-projects@FreeBSD.ORG Sat Jul 24 09:24:04 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 124B716A4D0; Sat, 24 Jul 2004 09:24:04 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF23A16A4CE for ; Sat, 24 Jul 2004 09:24:03 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAC7743D3F for ; Sat, 24 Jul 2004 09:24:03 +0000 (GMT) (envelope-from julian@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i6O9O3xK085130 for ; Sat, 24 Jul 2004 09:24:03 GMT (envelope-from julian@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i6O9O3Xf085127 for perforce@freebsd.org; Sat, 24 Jul 2004 09:24:03 GMT (envelope-from julian@freebsd.org) Date: Sat, 24 Jul 2004 09:24:03 GMT Message-Id: <200407240924.i6O9O3Xf085127@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to julian@freebsd.org using -f From: Julian Elischer To: Perforce Change Reviews Subject: PERFORCE change 58031 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2004 09:24:04 -0000 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;