Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 2015 10:02:03 -0700
From:      Neel Natu <neelnatu@gmail.com>
To:        Stefan Andritoiu <stefan.andritoiu@gmail.com>
Cc:        "freebsd-virtualization@freebsd.org" <freebsd-virtualization@freebsd.org>
Subject:   Re: How to bind a thread to a CPU?
Message-ID:  <E7D2C171-A34C-48BD-A027-013932D21FE2@gmail.com>
In-Reply-To: <CAO3d8=ZAOdjbXTV-bQHwWLopna2iw5=DRKFE1SD92R%2B62EGzaw@mail.gmail.com>
References:  <CAO3d8=b1dZU%2BfEi-r0P=WRMZ=rOF0D7WbGepsZ4Oe5q3eUrrLg@mail.gmail.com> <CAFgRE9FxHWB9bFHNxj%2Bv2fW79XoWDbWZ_4i456OCED7YGn9w7A@mail.gmail.com> <CAO3d8=ZAOdjbXTV-bQHwWLopna2iw5=DRKFE1SD92R%2B62EGzaw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Stefan,

> On Jun 13, 2015, at 12:12 PM, Stefan Andritoiu <stefan.andritoiu@gmail.com=
> wrote:
>=20
> Hi Neel,
>=20
>> On Sat, Jun 13, 2015 at 9:00 PM, Neel Natu <neelnatu@gmail.com> wrote:
>> Hi Stefan,
>>=20
>> On Sat, Jun 13, 2015 at 3:33 AM, Stefan Andritoiu
>> <stefan.andritoiu@gmail.com> 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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E7D2C171-A34C-48BD-A027-013932D21FE2>