From owner-p4-projects Thu Jun 13 11:41:46 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5861237B426; Thu, 13 Jun 2002 11:41:34 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by hub.freebsd.org (Postfix) with ESMTP id C6A9737B40D; Thu, 13 Jun 2002 11:41:32 -0700 (PDT) Received: from InterJet.elischer.org ([12.232.206.8]) by sccrmhc01.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020613184008.GPNQ1024.sccrmhc01.attbi.com@InterJet.elischer.org>; Thu, 13 Jun 2002 18:40:08 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id LAA95048; Thu, 13 Jun 2002 11:30:12 -0700 (PDT) Date: Thu, 13 Jun 2002 11:30:11 -0700 (PDT) From: Julian Elischer To: Brian Feldman Cc: Perforce Change Reviews Subject: Re: PERFORCE change 12837 for review In-Reply-To: <200206131800.g5DI0tp46864@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG thanks.. I had to rush off last night after jhb and I added that and we didn't have time to test it yet.. On Thu, 13 Jun 2002, Brian Feldman wrote: > http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12837 > > Change 12837 by green@green_laptop_1 on 2002/06/13 11:00:16 > > Make zombie_thread_lock back into a spin lock and remove the > condition where it could sleep; then, make the kernel actually > able to boot by adding it to witness's lock order list!!! > > Affected files ... > > ... //depot/projects/kse/sys/kern/kern_thread.c#67 edit > ... //depot/projects/kse/sys/kern/subr_witness.c#27 edit > > Differences ... > > ==== //depot/projects/kse/sys/kern/kern_thread.c#67 (text+ko) ==== > > @@ -75,7 +75,7 @@ > tdlist_head_t zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads); > struct mtx zombie_thread_lock; > MTX_SYSINIT(zombie_thread_lock, &zombie_thread_lock, > - "zombie_thread_lock", MTX_DEF); > + "zombie_thread_lock", MTX_SPIN); > > /* > * Pepare a thread for use. > @@ -241,9 +241,9 @@ > void > thread_stash(struct thread *td) > { > - mtx_lock(&zombie_thread_lock); > + mtx_lock_spin(&zombie_thread_lock); > TAILQ_INSERT_HEAD(&zombie_threads, td, td_runq); > - mtx_unlock(&zombie_thread_lock); > + mtx_unlock_spin(&zombie_thread_lock); > } > > /* > @@ -252,18 +252,17 @@ > void > thread_reap(void) > { > - struct thread *td_reaped, *td_next; > + struct thread *td_reaped; > > - mtx_lock(&zombie_thread_lock); > - td_reaped = TAILQ_FIRST(&zombie_threads); > - while (td_reaped) { > - td_next = TAILQ_NEXT(td_reaped, td_runq); > + mtx_lock_spin(&zombie_thread_lock); > + while (!TAILQ_EMPTY(&zombie_threads)) { > + td_reaped = TAILQ_FIRST(&zombie_threads); > TAILQ_REMOVE(&zombie_threads, td_reaped, td_runq); > + mtx_unlock_spin(&zombie_thread_lock); > thread_free(td_reaped); > - td_reaped = td_next; > + mtx_lock_spin(&zombie_thread_lock); > } > - mtx_unlock(&zombie_thread_lock); > - > + mtx_unlock_spin(&zombie_thread_lock); > } > > /* > > ==== //depot/projects/kse/sys/kern/subr_witness.c#27 (text+ko) ==== > > @@ -225,6 +225,7 @@ > #endif > { "clk", &lock_class_mtx_spin }, > { "mutex profiling lock", &lock_class_mtx_spin }, > + { "zombie_thread_lock", &lock_class_mtx_spin }, > { NULL, NULL }, > { NULL, NULL } > }; > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message