From owner-freebsd-virtualization@FreeBSD.ORG Sun Jun 14 17:02:10 2015 Return-Path: Delivered-To: freebsd-virtualization@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C301BC9A for ; Sun, 14 Jun 2015 17:02:10 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-pd0-x22f.google.com (mail-pd0-x22f.google.com [IPv6:2607:f8b0:400e:c02::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9180ED8C for ; Sun, 14 Jun 2015 17:02:10 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: by pdjn11 with SMTP id n11so55952092pdj.0 for ; Sun, 14 Jun 2015 10:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=QH0dfWKCdQZBoVjYPav/SNK/1Y08qwxduC5ZsirL6VE=; b=SfglR3dRf01W7NQgCadOsdLc5RxmOpK8Pt4P55rg0VgnZQv3Jxk8oFpjudW/ER0EN+ v386//DMho7hrFoV8bsfFczDReOeo7ZeO6GC3nFT4l94ZFNqDuZHJP3+oBjVaa2s50WK kT5E0X7wkgQM1flyt4ux+YBmbEuWdkkf4Fau+NV6p/jGEpTRvjjQcdoBUEdkO22eRThl VEOY7skSCmN3a7AFY1tOUT85cr8Flt6pGY2n/9fhscuA/K6vfCqChL2c+Oqxsm26Cefy anZQiZF4kReNz8aztHYBa9VVD9q/g7FisCGYyh0wmMVfqIIrM1chJ76S/FLLpMKacOr/ 1t9g== X-Received: by 10.68.192.98 with SMTP id hf2mr40238779pbc.142.1434301330005; Sun, 14 Jun 2015 10:02:10 -0700 (PDT) Received: from [192.168.1.95] (108-228-13-158.lightspeed.sntcca.sbcglobal.net. [108.228.13.158]) by mx.google.com with ESMTPSA id c1sm9662534pdc.45.2015.06.14.10.02.07 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Jun 2015 10:02:08 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Cc: "freebsd-virtualization@freebsd.org" X-Mailer: iPhone Mail (11D257) From: Neel Natu Subject: Re: How to bind a thread to a CPU? Date: Sun, 14 Jun 2015 10:02:03 -0700 To: Stefan Andritoiu X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Jun 2015 17:02:10 -0000 Hi Stefan, > On Jun 13, 2015, at 12:12 PM, Stefan Andritoiu wrote: >=20 > Hi Neel, >=20 >> On Sat, Jun 13, 2015 at 9:00 PM, Neel Natu wrote: >> Hi Stefan, >>=20 >> On Sat, Jun 13, 2015 at 3:33 AM, Stefan Andritoiu >> wrote: >>> Hi, >>>=20 >>> How can I pin a thread to run only on a specific CPU? >>> Is it enough just to set the "struct cpuset *td_cpuset" of the thread? >>=20 >> sched_bind() is the proper way to do this. >=20 > But in sched_bind() I notice: > KASSERT(td =3D=3D curthread, ("sched_bind: can only bind curthread")); >=20 > How can I bind a thread that is not curthread? I don't know offhand but your original suggestion of 'td_cpuset' does seem l= ike a reasonable place to start. Best Neel >=20 >>=20 >> best >> Neel >>=20 >>> Thank you, >>> Stefan >>> _______________________________________________ >>> freebsd-virtualization@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization >>> To unsubscribe, send any mail to "freebsd-virtualization-unsubscribe@fre= ebsd.org"