From owner-freebsd-smp@FreeBSD.ORG Fri Feb 23 16:36:21 2007 Return-Path: X-Original-To: freebsd-smp@freebsd.org Delivered-To: freebsd-smp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D7DC316A403 for ; Fri, 23 Feb 2007 16:36:21 +0000 (UTC) (envelope-from aaron.kunze@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx1.freebsd.org (Postfix) with ESMTP id A959C13C478 for ; Fri, 23 Feb 2007 16:36:21 +0000 (UTC) (envelope-from aaron.kunze@intel.com) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by mga01.intel.com with ESMTP; 23 Feb 2007 08:36:21 -0800 Received: from orsmsx334.jf.intel.com ([10.22.226.45]) by fmsmga001.fm.intel.com with ESMTP; 23 Feb 2007 08:36:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,212,1170662400"; d="scan'208"; a="203364185:sNHT23588166" Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 23 Feb 2007 08:36:18 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Feb 2007 08:35:58 -0800 Message-ID: <07DDDFCFB8BE0A43BCA52E743373DBDC03102190@orsmsx416.amr.corp.intel.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Setting CPU affinity to process( Freebsd smp kernel) thread-index: AcdXZQQl/6foEZcqTH+NbboIQZM3dwAAt75w References: <07DDDFCFB8BE0A43BCA52E743373DBDC030C5D5A@orsmsx416.amr.corp.intel.com> <20070223151158.Q88189@fledge.watson.org> From: "Kunze, Aaron" To: "Daniel Eischen" , "Robert Watson" X-OriginalArrivalTime: 23 Feb 2007 16:36:18.0226 (UTC) FILETIME=[BE2E2920:01C75768] Cc: atmblr@gmail.com, freebsd-smp@freebsd.org Subject: RE: Setting CPU affinity to process( Freebsd smp kernel) X-BeenThere: freebsd-smp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD SMP implementation group List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2007 16:36:21 -0000 Thanks for the info. The Linux equivalent would be sched_setaffinity which takes a bitmask as input, allowing the user to define which processors will run a particular thread. Here's a link: http://ibm5.ma.utexas.edu/cgi-bin/man-cgi?sched_setaffinity+2 > > There's a potential for=20 > > conflict between the kernel's use of pinning and binding for kernel=20 > > synchronization and the user space affinity model, which will be=20 Can you elaborate on this? Some of my colleagues and I are considering tackling this and would like to avoid such pitfalls, if possible. Aaron -------------------------- Aaron Kunze Advanced Visual Computing aaron.kunze@intel.com --PGP Key ID: 0x81124B7C-- --NOT SPEAKING FOR INTEL-- -------GO BOILERS!!------- =20 > -----Original Message----- > From: Daniel Eischen [mailto:deischen@freebsd.org]=20 > Sent: Friday, February 23, 2007 8:09 AM > To: Robert Watson > Cc: Kunze, Aaron; atmblr@gmail.com; freebsd-smp@freebsd.org > Subject: Re: Setting CPU affinity to process( Freebsd smp kernel) >=20 > On Fri, 23 Feb 2007, Robert Watson wrote: >=20 > > On Wed, 21 Feb 2007, Kunze, Aaron wrote: > > > >> Does anyone know if this will change any time soon? For=20 > example, is=20 > >> anyone working on exposing affinity to user-space applications via=20 > >> extensions of the pthreads interface? > >>=20 > >> Sorry to reply to such an old thread... > > > > I know of no work along these lines currently, but it's something a=20 > > lot of people would like to see happen. There's a potential for=20 > > conflict between the kernel's use of pinning and binding for kernel=20 > > synchronization and the user space affinity model, which will be=20 > > entirely avoided if done right. :-) For now, it's quite=20 > easy to add a=20 > > sysctl/syscall that allows user space to send the kernel=20 > scheduler's=20 > > notion of thread binding, but this isn't really the right=20 > approach. =20 > > As I understand it, some systems support setting CPU=20 > affinity for a thread as a set of CPUs it is willing to run on ? >=20 > I know Solaris has processor_bind(2) and pset_bind(2): >=20 > http://docs.sun.com/app/docs/doc/816-5167/6mbb2jaeu?a=3Dexpand#P >=20 > -- > DE >=20