From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 28 13:22:17 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 2B497106566C for ; Sat, 28 Jan 2012 13:22:17 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 8ACF48FC12 for ; Sat, 28 Jan 2012 13:22:16 +0000 (UTC) Received: by wgbdr11 with SMTP id dr11so2846766wgb.31 for ; Sat, 28 Jan 2012 05:22:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=R2Bl2pP8EvEKIHaRDJrUdTXEIbSIgeVjHxYRXxABTBM=; b=h7EdcPXmT240kuTFPF2xntbpOIRJZX8OVSYWb53mUr+1vhoKhXr+0iEkDSC3xnY7Sh cSxVI2gN/DGFSjVxCuEdeHGY+sSHPVP1svxZQeqbxI4hEVT4kOsJ7Cq8Xm9FDcAGTy50 1lZ77JDuQJk1fXJ239d08YdMmi9TlWr7mcVaI= MIME-Version: 1.0 Received: by 10.180.99.199 with SMTP id es7mr17097578wib.10.1327756935648; Sat, 28 Jan 2012 05:22:15 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.177.73 with HTTP; Sat, 28 Jan 2012 05:22:15 -0800 (PST) In-Reply-To: References: Date: Sat, 28 Jan 2012 14:22:15 +0100 X-Google-Sender-Auth: yWPJ0snojx1dlKOxD5AlGyVxc5E Message-ID: From: Attilio Rao To: Ryan Stone , Peter Holm , Florian Smeets Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org 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: Sat, 28 Jan 2012 13:22:17 -0000 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! =C2=A0I 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. =C2=A0I 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 patc= h? Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein