From owner-freebsd-hackers@FreeBSD.ORG Sat Jan 28 04:45:45 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 057A2106564A for ; Sat, 28 Jan 2012 04:45:45 +0000 (UTC) (envelope-from rysto32@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 641738FC24 for ; Sat, 28 Jan 2012 04:45:44 +0000 (UTC) Received: by werm13 with SMTP id m13so420400wer.13 for ; Fri, 27 Jan 2012 20:45:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=W2DUq4Z4po0gP/1y7y+GRUZydWgqTLTA3SnFmV5Q/dI=; b=SmIxwpLrvDQ2y3VuYDQ2Re/Tdxt6OY8fyUKH6W4luOc4R4ZCaYkMbTkGh7R+6Sz7+o WklSpybxupVR37NQdaEfn2aGaFdbtYwUOsGTRRqTkrl8FOUVtIqRBF1bEzufaZdye9qe eFRPhyzMmi1q/nrrG3OWnWcrMJdlfNbdau7Cs= MIME-Version: 1.0 Received: by 10.216.131.67 with SMTP id l45mr3855716wei.21.1327725943229; Fri, 27 Jan 2012 20:45:43 -0800 (PST) Received: by 10.180.106.129 with HTTP; Fri, 27 Jan 2012 20:45:43 -0800 (PST) In-Reply-To: References: Date: Fri, 27 Jan 2012 23:45:43 -0500 Message-ID: From: Ryan Stone To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 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 04:45:45 -0000 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).