From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 28 13:41:00 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 8CD911065677; Sat, 28 Jan 2012 13:41:00 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E20288FC19; Sat, 28 Jan 2012 13:40:59 +0000 (UTC) Received: by werm13 with SMTP id m13so752948wer.13 for ; Sat, 28 Jan 2012 05:40:59 -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=S7Uj3U2SHxqt7mmmeJ4+wqwQxzlwoimnVanVe4nrFHQ=; b=uWLLfuOfugxA+A9c7cjyj7BvLCWV/SgJITEYIybrd+HGm9k7OX2UYPKrfBS1V/XeMz OqCXMFzqRkfR4TQCRO1DXDQ+uBOekovX9Eba3/aujirlb3HCa2hcn+mJ66oaoDeDI5rC NVYBshwrONRVKJBGjr3b/Y5cHtIB//zoblQ2c= MIME-Version: 1.0 Received: by 10.216.133.82 with SMTP id p60mr4549912wei.59.1327757958014; Sat, 28 Jan 2012 05:39:18 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.177.73 with HTTP; Sat, 28 Jan 2012 05:39:17 -0800 (PST) In-Reply-To: References: Date: Sat, 28 Jan 2012 14:39:17 +0100 X-Google-Sender-Auth: iR_1uY0lPXOiuHgBXlTX0Nwy2Pw 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:41:00 -0000 2012/1/28 Attilio Rao : > 2012/1/28 Ryan Stone : >> On Fri, Jan 27, 2012 at 10:41 PM, Attilio Rao wrot= e: >>> 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 fixe= d >> 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 pa= tch? BTW, I've just now updated the patch in order to remove an added white line and s/priority/affinity in comments. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein