From owner-freebsd-arch@FreeBSD.ORG Tue Feb 26 22:14:26 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFE9C1065674; Tue, 26 Feb 2008 22:14:26 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4FA8613C45A; Tue, 26 Feb 2008 22:14:26 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.107] (cpe-24-94-75-93.hawaii.res.rr.com [24.94.75.93]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id m1QMENa0050294; Tue, 26 Feb 2008 17:14:24 -0500 (EST) (envelope-from jroberson@chesapeake.net) Date: Tue, 26 Feb 2008 12:16:06 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Daniel Eischen In-Reply-To: Message-ID: <20080226121251.V920@desktop> References: <20080220175532.Q920@desktop> <20080220213253.A920@desktop> <20080221092011.J52922@fledge.watson.org> <20080222121253.N920@desktop> <20080222231245.GA28788@lor.one-eyed-alien.net> <20080222134923.M920@desktop> <20080223194047.GB38485@lor.one-eyed-alien.net> <20080223111659.K920@desktop> <20080223213507.GD39699@lor.one-eyed-alien.net> <20080224001902.J920@desktop> <20080225231747.GT99258@elvis.mu.org> <20080225143222.B920@desktop> <20080225160433.P920@desktop> <20080225194320.V920@desktop> <20080225213434.L920@desktop> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Brooks Davis , Andrew Gallatin , Alfred Perlstein , arch@freebsd.org, Robert Watson , David Xu Subject: Re: cpuset and affinity implementation X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 22:14:26 -0000 On Tue, 26 Feb 2008, Daniel Eischen wrote: > On Mon, 25 Feb 2008, Jeff Roberson wrote: > >> Binding a processor set to the process simply sets the per-thread binding >> of each thread in the process. There is otherwise no specific process >> binding. We could keep a pointer to the last specifically bound set in the >> process if we wanted, but what would it be used for other than querying the >> id of the process? What if each thread was seperately specifically bound >> to a different set? What set should be used on fork? The set of the >> process or the thread that called fork? What about when creating a new >> thread? > > The set used on fork should be the set of the calling thread, > same concept as signal masks I would think. Same thing when > creating a new thread. I guess I'd check how Linux and Solaris > do it, see if they are consistent. Yes, that's what I do now. The mask is inherited from the creater. I was just pointing out that it gets a little ambiguous if we were to have some notion of a per-process set. > > I can see how you might _not_ want to inherit bindings in a > created thread. For a process with real-time threads, the > application might start with superuser privileges, create some > threads with real-time priority and set their bindings, then > setuid() to remove superuser privileges. Is a privilege check > made in a newly created thread when applying inherited bindings? No privilege check on fork. This would create weird failure modes. > >> See above discussion. I'm not sure what you mean by 'default' cpuset here. > > I imagine the 'default' cpuset as the system's default cpuset, > in lieu of any administratively created cpusets and bindings > for the process (inherited or explicit). My opinion is that if we decide that it's important to assign numbered sets to tids we need then to allow cpuset_getid to return multiple ids for WHICH_PID. Jeff > > -- > DE >