From owner-cvs-all Fri Sep 21 16:31:33 2001 Delivered-To: cvs-all@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id 65EC137B41B; Fri, 21 Sep 2001 16:31:19 -0700 (PDT) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id RAA38426; Fri, 21 Sep 2001 17:15:07 -0700 (PDT) Date: Fri, 21 Sep 2001 17:15:07 -0700 (PDT) From: Julian Elischer To: John Baldwin Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/kern sys_generic.c In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Actually there is exactly ONE flag that got mixed.. and you have luckily found it.. On Fri, 21 Sep 2001, John Baldwin wrote: > > On 21-Sep-01 Julian Elischer wrote: > > > > > > On Fri, 21 Sep 2001, John Baldwin wrote: > > > >> jhb 2001/09/21 15:06:22 PDT > >> > >> Modified files: > >> sys/kern sys_generic.c > >> Log: > >> The P_SELECT flag was moved from p->p_flag to td->td_flags, but p_flag > >> was locked by the proc lock and td_flags is locked by the sched_lock. > >> The places that read, set, and cleared TDF_SELECT weren't updated, so they > >> read and modified td_flags w/o holding the sched_lock, meaning that they > >> could corrupt the per-thread flags field. As an immediate band-aid, > >> grab sched_lock while reading and manipulating td_flags in relation to > >> TDF_SELECT. This will probably be cleaned up some later on. > > > > > > reading this again I think the clue is: > > > > "and td_flags is locked by the sched_lock" > > > > I don't know how this can be true unless it's been done recently.. > > Whatever locking was used for p_flag was left alone when I change it to > > td_flags in some places, so if p_flag was locked by the proc lock then > > td_flags should also be locked by it.. (I didn't change any occurances of > > the prock lock to be occurances of the sched lock)! > > If you recall our earlier discussion regarding TDF_DEADLKTREAT, you told me you > had split up p_sflag into teh various flags, not p_flag. Actually, it seems > you did exactly what I first feared: you mixed P_* flags and PS_* flags which > had different locking semantics. (That's why p_flag was originally split up > into the p_flag and p_sflag fields for SMPng.) > > -- > > John Baldwin -- http://www.FreeBSD.org/~jhb/ > PGP Key: http://www.baldwin.cx/~john/pgpkey.asc > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message