From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 29 11:02:27 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 032B1106566C for ; Sun, 29 Jan 2012 11:02:27 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id AABA48FC0A for ; Sun, 29 Jan 2012 11:02:26 +0000 (UTC) Received: (qmail 90964 invoked from network); 29 Jan 2012 10:35:44 -0000 Received: from 87.58.144.241 (HELO x2.osted.lan) (87.58.144.241) by relay00.pair.com with SMTP; 29 Jan 2012 10:35:44 -0000 X-pair-Authenticated: 87.58.144.241 Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.4/8.14.4) with ESMTP id q0TAZhAb018571; Sun, 29 Jan 2012 11:35:43 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.4/8.14.4/Submit) id q0TAZgtd018570; Sun, 29 Jan 2012 11:35:42 +0100 (CET) (envelope-from pho) Date: Sun, 29 Jan 2012 11:35:42 +0100 From: Peter Holm To: Attilio Rao Message-ID: <20120129103542.GA18535@x2.osted.lan> References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org, Florian Smeets , Ryan Stone Subject: Re: Kernel threads inherit CPU affinity from random sibling X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 11:02:27 -0000 On Sat, Jan 28, 2012 at 02:39:17PM +0100, Attilio Rao wrote: > 2012/1/28 Attilio Rao : > > 2012/1/28 Ryan Stone : > >> On Fri, Jan 27, 2012 at 10:41 PM, Attilio Rao wrote: > >>> I think what you found out is very sensitive. > >>> However, the patch is not correct as you cannot call > >>> cpuset_setthread() with thread_lock held. > >> > >> Whoops!  I actually discovered that for myself and had already fixed > >> it, but apparently I included an old version of the patch in the > >> email. > >> > >>> Hence this is my fix: > >>> http://www.freebsd.org/~attilio/cpuset_root.patch > >> > >> Oh, I do like this better.  I tried something similar myself but > >> abandoned it because I misread how sched_affinity() was implemented by > >> 4BSD(I had gotten the impression that once TSF_AFFINITY is set it > >> could never be cleared). > > > > Do you have a pathological test-case for it? Are you going to test the patch? > > BTW, I've just now updated the patch in order to remove an added white > line and s/priority/affinity in comments. > I've tested this patch with what I got of threaded test scenarios, for 14 hours without finding any issues. - Peter