Date: Thu, 16 May 2002 21:41:47 -0700 From: Jonathan Mini <mini@freebsd.org> To: Julian Elischer <julian@elischer.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 11120 for review Message-ID: <20020516214147.B25907@stylus.haikugeek.com> In-Reply-To: <3CDC2BB5.366A7BF0@elischer.org>; from julian@elischer.org on Fri, May 10, 2002 at 01:21:09PM -0700 References: <200205101530.g4AFUn510685@freefall.freebsd.org> <3CDC2BB5.366A7BF0@elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Julian Elischer [julian@elischer.org] wrote : > > + /* Reassign this thread's KSE. */ > > + if (ke != NULL) { > > + ke->ke_thread = NULL; > > WHOA! just because ke == td->td_kse doesn't mean that > ke->ke_thread == td > > UNLESS you can guarantee that thread unlink is always run with td == curthread > or td->td_state == TDS_RUNNING. thread_unlink() (quoted above) is only called from thread_exit(). thread_exit() exits the currently scheduled thread, so td == curthread and td->td_state == TDS_RUNNING. We're safe both ways. > > + p->p_numthreads--; > > what of the kg->kg_numthreads.. Ten lines down, is : > > + if (kg != NULL) > > + kg->kg_numthreads--; > > move this up? To before the proc is unlinked? Why? > plus other comments already noted by others.. > (tabbing and sleeping with locks) The tabbing is fixed. As for sleeping with locks in UMA functions, Jeff said that it is ok to sleep for a short time, but long-term sleeps aren't such a good idea (makes sense). The only problem he foresaw was that the init/fini functions could be called by the pager daemon, but I don't see any problem there either. Somebody, please correct me if I'm wrong. -- Jonathan Mini <mini@freebsd.org> http://www.haikugeek.com "He who is not aware of his ignorance will be only misled by his knowledge." -- Richard Whatley 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?20020516214147.B25907>