From owner-freebsd-virtualization@FreeBSD.ORG Sat Jun 13 19:12:11 2015 Return-Path: Delivered-To: freebsd-virtualization@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3C0A7C06 for ; Sat, 13 Jun 2015 19:12:11 +0000 (UTC) (envelope-from stefan.andritoiu@gmail.com) Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com [IPv6:2607:f8b0:4003:c01::22d]) (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 02001E14 for ; Sat, 13 Jun 2015 19:12:11 +0000 (UTC) (envelope-from stefan.andritoiu@gmail.com) Received: by obcej4 with SMTP id ej4so41494146obc.0 for ; Sat, 13 Jun 2015 12:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UNeLP/xKGL7PeWfOfJkuOyaB5cyPsUrQ2ybMVynbxBo=; b=bTbxsW8tMBQwjKUyhyvLEpqrmuIwrsRm0ELNOtsSfGHzaIgR17aUrwKau+yqkE5aYw CWgJ21Whj95jJLFws6rMnDgNAI3XO8724Kfd3wtRpxcwnoybd6Cc+1wQasZGXSeLGSqm QCcmHT2xmIaKG7pUapg4gj55+PWYdQ1uktoG9sHzOywDqv+2HbqwsVHsCuScKFfwRQfB JwatQ9mg2FfIVMkK/bZ09YZDVPsUB7NuR5sjswHdFZz/vVnodTv3CjMwmIpeBgkE0fEl JlYAR5JUIVcnq2xf7G1cpMqFOXIj8TQCw5G0NlGcEEEIdjHQ7QmQO4NoVheFrUYMvgPT zzag== MIME-Version: 1.0 X-Received: by 10.60.16.133 with SMTP id g5mr17299808oed.66.1434222730193; Sat, 13 Jun 2015 12:12:10 -0700 (PDT) Received: by 10.60.82.168 with HTTP; Sat, 13 Jun 2015 12:12:10 -0700 (PDT) In-Reply-To: References: Date: Sat, 13 Jun 2015 22:12:10 +0300 Message-ID: Subject: Re: How to bind a thread to a CPU? From: Stefan Andritoiu To: Neel Natu Cc: "freebsd-virtualization@freebsd.org" Content-Type: text/plain; charset=UTF-8 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: Sat, 13 Jun 2015 19:12:11 -0000 Hi Neel, On Sat, Jun 13, 2015 at 9:00 PM, Neel Natu wrote: > Hi Stefan, > > On Sat, Jun 13, 2015 at 3:33 AM, Stefan Andritoiu > wrote: >> Hi, >> >> 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? >> > > sched_bind() is the proper way to do this. But in sched_bind() I notice: KASSERT(td == curthread, ("sched_bind: can only bind curthread")); How can I bind a thread that is not curthread? > > best > Neel > >> 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@freebsd.org"