From owner-cvs-all Fri Sep 21 16:16:58 2001 Delivered-To: cvs-all@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 66E9E37B411; Fri, 21 Sep 2001 16:16:49 -0700 (PDT) Received: from laptop.baldwin.cx ([147.11.46.201]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id QAA13518; Fri, 21 Sep 2001 16:16:47 -0700 (PDT) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010921180304.I97903@elvis.mu.org> Date: Fri, 21 Sep 2001 16:16:34 -0700 (PDT) From: John Baldwin To: Alfred Perlstein Subject: Re: cvs commit: src/sys/kern sys_generic.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Julian Elischer 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 On 21-Sep-01 Alfred Perlstein wrote: > * Julian Elischer [010921 17:52] 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)! > > I think John should start passing these diffs by Julian so this > doesn't result in the same problem of the vm mutex where so many > people jumped in to "fix" things without consulting me that it had > to be backed out because I was no longer sure what the hell had > been done to it. Fair enough re: review. All I did in this case was add lock acquire and releases though. I didn't move any flags around or change any code specifically because this is a band-aid fix. > I'm seeing someone (not me) stepping up to back out this whole mess > if it snowballs and I think that would be a shame. Nah, these are minor nits, not major breakages at all. Backing this out would be rather dumb. -- 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