Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jan 2012 11:35:42 +0100
From:      Peter Holm <peter@holm.cc>
To:        Attilio Rao <attilio@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Florian Smeets <flo@smeets.im>, Ryan Stone <rysto32@gmail.com>
Subject:   Re: Kernel threads inherit CPU affinity from random sibling
Message-ID:  <20120129103542.GA18535@x2.osted.lan>
In-Reply-To: <CAJ-FndC1WHMyAXbT-rW=Ar%2BpspiwW%2B8cBF3OV4gMJssaO4UPUg@mail.gmail.com>
References:  <CAFMmRNxF1uMOr39BbZkpPN=uM7G09dtcckAYw8ag6n6bi=FeOw@mail.gmail.com> <CAJ-FndDHsQRRNmrS7fsELEVohozWvvfaZ6eW_GipwHdjU9ZwxA@mail.gmail.com> <CAFMmRNyPkwx3hRtraq6QL64kibAeV3W23FE34T1oDnf9SVFOYg@mail.gmail.com> <CAJ-FndD3366-uT191jMva3P-uL0DHi6nFeRfdsKA1hbJW7WqEA@mail.gmail.com> <CAJ-FndC1WHMyAXbT-rW=Ar%2BpspiwW%2B8cBF3OV4gMJssaO4UPUg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jan 28, 2012 at 02:39:17PM +0100, Attilio Rao wrote:
> 2012/1/28 Attilio Rao <attilio@freebsd.org>:
> > 2012/1/28 Ryan Stone <rysto32@gmail.com>:
> >> On Fri, Jan 27, 2012 at 10:41 PM, Attilio Rao <attilio@freebsd.org> wrote:
> >>> I think what you found out is very sensitive.
> >>> However, the patch is not correct as you cannot call
> >>> cpuset_setthread() with thread_lock held.
> >>
> >> Whoops!  I actually discovered that for myself and had already fixed
> >> it, but apparently I included an old version of the patch in the
> >> email.
> >>
> >>> Hence this is my fix:
> >>> http://www.freebsd.org/~attilio/cpuset_root.patch
> >>
> >> Oh, I do like this better.  I tried something similar myself but
> >> abandoned it because I misread how sched_affinity() was implemented by
> >> 4BSD(I had gotten the impression that once TSF_AFFINITY is set it
> >> could never be cleared).
> >
> > Do you have a pathological test-case for it? Are you going to test the patch?
> 
> BTW, I've just now updated the patch in order to remove an added white
> line and s/priority/affinity in comments.
> 

I've tested this patch with what I got of threaded test scenarios, for
14 hours without finding any issues.

- Peter



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120129103542.GA18535>