From owner-svn-src-all@FreeBSD.ORG Tue Jan 26 06:52:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F011106566C; Tue, 26 Jan 2010 06:52:29 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-qy0-f176.google.com (mail-qy0-f176.google.com [209.85.221.176]) by mx1.freebsd.org (Postfix) with ESMTP id EB3EF8FC08; Tue, 26 Jan 2010 06:52:28 +0000 (UTC) Received: by qyk6 with SMTP id 6so2598148qyk.3 for ; Mon, 25 Jan 2010 22:52:28 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.74.209 with SMTP id v17mr4700776qaj.44.1264487120452; Mon, 25 Jan 2010 22:25:20 -0800 (PST) X-Originating-IP: [128.95.133.190] In-Reply-To: <201001231554.o0NFsMbx049837@svn.freebsd.org> References: <201001231554.o0NFsMbx049837@svn.freebsd.org> Date: Mon, 25 Jan 2010 22:25:20 -0800 Message-ID: From: Rob Farmer To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r202889 - 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: Tue, 26 Jan 2010 06:52:29 -0000 On Sat, Jan 23, 2010 at 7:54 AM, Attilio Rao wrote: > Author: attilio > Date: Sat Jan 23 15:54:21 2010 > New Revision: 202889 > URL: http://svn.freebsd.org/changeset/base/202889 > > Log: > =A0- Fix a race in sched_switch() of sched_4bsd. > =A0 =A0In the case of the thread being on a sleepqueue or a turnstile, th= e > =A0 =A0sched_lock was acquired (without the aid of the td_lock interface)= and > =A0 =A0the td_lock was dropped. This was going to break locking rules on = other > =A0 =A0threads willing to access to the thread (via the td_lock interface= ) and > =A0 =A0modify his flags (allowed as long as the container lock was differ= ent > =A0 =A0by the one used in sched_switch). > =A0 =A0In order to prevent this situation, while sched_lock is acquired t= here > =A0 =A0the td_lock gets blocked. [0] > =A0- Merge the ULE's internal function thread_block_switch() into the glo= bal > =A0 =A0thread_lock_block() and make the former semantic as the default fo= r > =A0 =A0thread_lock_block(). This means that thread_lock_block() will not > =A0 =A0disable interrupts when called (and consequently thread_unlock_blo= ck() > =A0 =A0will not re-enabled them when called). This should be done manuall= y > =A0 =A0when necessary. > =A0 =A0Note, however, that ULE's thread_unblock_switch() is not reaped > =A0 =A0because it does reflect a difference in semantic due in ULE (the > =A0 =A0td_lock may not be necessarilly still blocked_lock when calling th= is). > =A0 =A0While asymmetric, it does describe a remarkable difference in sema= ntic > =A0 =A0that is good to keep in mind. > > =A0[0] Reported by: =A0 =A0 =A0Kohji Okuno > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0Tested by: =A0 =A0 =A0 =A0 =A0 =A0Giovanni Trematerra > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0MFC: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A02 weeks > > Modified: > =A0head/sys/kern/kern_mutex.c > =A0head/sys/kern/sched_4bsd.c > =A0head/sys/kern/sched_ule.c Hi, This commit seems to be causing me a kernel panic on sparc64 - details are in PR 143215. Could you take a look before MFCing this? Thanks, --=20 Rob Farmer