From owner-freebsd-current@FreeBSD.ORG Mon Feb 25 23:33:25 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CE0216A401 for ; Mon, 25 Feb 2008 23:33:25 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (cl-162.ewr-01.us.sixxs.net [IPv6:2001:4830:1200:a1::2]) by mx1.freebsd.org (Postfix) with ESMTP id D6BEC13C4DB for ; Mon, 25 Feb 2008 23:33:24 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.1/8.13.8) with ESMTP id m1PNXFp8062975; Mon, 25 Feb 2008 17:33:15 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.1/8.13.8/Submit) id m1PNXFrO062974; Mon, 25 Feb 2008 17:33:15 -0600 (CST) (envelope-from brooks) Date: Mon, 25 Feb 2008 17:33:15 -0600 From: Brooks Davis To: Jeff Roberson Message-ID: <20080225233315.GA59569@lor.one-eyed-alien.net> References: <20080224173229.I920@desktop> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="r5Pyd7+fXNt84Ff3" Content-Disposition: inline In-Reply-To: <20080224173229.I920@desktop> User-Agent: Mutt/1.5.16 (2007-06-09) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Mon, 25 Feb 2008 17:33:16 -0600 (CST) Cc: current@freebsd.org Subject: Re: cpuset and affinity implementation X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 23:33:25 -0000 --r5Pyd7+fXNt84Ff3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 24, 2008 at 05:38:37PM -1000, Jeff Roberson wrote: > Hello, >=20 > I have implemented a new api similar to processors sets on solaris. This= =20 > allows you to assign processes to sets of cpus and dynamically change tho= se=20 > sets. This is useful for provisioning purposes to add and remove cpu=20 > resources for a particular process or group of processes. This new=20 > facility also supports binding secific threads to specific cpus which som= e=20 > applications may want to do. At some point in the future this will be=20 > integrated with jail so you can restrict the cpus any jail is allowed to= =20 > use. >=20 > This api should not be considered final and the 'cpuset' tool is quite=20 > rough. This also only works with ULE and is unfortunately intertwined wi= th=20 > a big ULE patch I've been working on. The set management code is generic= =20 > but 4BSD doesn't contain the hooks to actually constrain threads. I took a look at the patch this morning. The API looks like it's capable of doing what I need, at least at a first pass. It looks like I should be able to implement the semantics currently employed by the Sun Grid Engine scheduler on Irix systems. The one thing I noticed that I found worrying was the recursion in cpuset_(test)update(). It wasn't immediately clear to me there there is anything to would prevent an arbitrarily deep hierarchy from being created and blowing the kernel stack. I'm I missing something? -- Brooks --r5Pyd7+fXNt84Ff3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFHw1A6XY6L6fI4GtQRAt7RAJ9EXhkn7LZ2Lm7hKowce3NqNiv02ACg1aZf Tauye9p9tvkOzlAnM35sk0Y= =wuVu -----END PGP SIGNATURE----- --r5Pyd7+fXNt84Ff3--