From owner-svn-src-all@FreeBSD.ORG Sat May 12 07:38:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 547391065674; Sat, 12 May 2012 07:38:04 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id C48FF8FC08; Sat, 12 May 2012 07:38:03 +0000 (UTC) Received: from c122-106-171-232.carlnfd1.nsw.optusnet.com.au (c122-106-171-232.carlnfd1.nsw.optusnet.com.au [122.106.171.232]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q4C7bs8B009777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 12 May 2012 17:37:55 +1000 Date: Sat, 12 May 2012 17:37:54 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Xin LI In-Reply-To: Message-ID: <20120512172928.U926@besplex.bde.org> References: <201205112343.q4BNhWh7005829@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-609456488-1336808274=:926" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r235301 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2012 07:38:04 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-609456488-1336808274=:926 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 11 May 2012, Xin LI wrote: >> Log: >> =C2=A0Revert previous revision, misunderstood the code :( >> >> Modified: >> =C2=A0head/sys/kern/kern_kthread.c >> >> Modified: head/sys/kern/kern_kthread.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/kern_kthread.c =C2=A0 =C2=A0 =C2=A0 =C2=A0Fri May 11 2= 3:41:52 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r235300) >> +++ head/sys/kern/kern_kthread.c =C2=A0 =C2=A0 =C2=A0 =C2=A0Fri May 11 2= 3:43:32 2012 =C2=A0 =C2=A0 =C2=A0 =C2=A0(r235301) >> @@ -182,7 +182,6 @@ kproc_suspend(struct proc *p, int timo) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return (EINVAL); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0} >> =C2=A0 =C2=A0 =C2=A0 =C2=A0SIGADDSET(p->p_siglist, SIGSTOP); >> - =C2=A0 =C2=A0 =C2=A0 PROC_UNLOCK(p); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0wakeup(p); >> =C2=A0 =C2=A0 =C2=A0 =C2=A0return msleep(&p->p_siglist, &p->p_mtx, PPAUS= E | PDROP, "suspkp", timo); Please don't use mailer clients that corrupt whitespace to binary character= s. The above is unreadable in vi (but i remember it from the original). > For the record, p->p_mtx is the mutex used by PROC_[UN]LOCK(), which > has to be held while calling msleep(). Even if it weren't, dropping the lock before sleeping would give a classic race. Otherwise, PROC_UNLOCK() is a good obfuscation. p_mtx in the sleep call isn't similarly obfuscated. Some subsystems have a macro that obfuscates the name of their lock(s) too, but proc.h doesn't. kern/*.c has 23 hard-coded references of the form &somep->p_mtx. Bruce --0-609456488-1336808274=:926--