locks and kernel randomness...

Konstantin Belousov kostikbel at gmail.com
Wed Feb 25 10:21:26 UTC 2015


On Wed, Feb 25, 2015 at 02:17:12AM -0800, Harrison Grundy wrote:
> 
> 
> On 02/25/15 02:05, Konstantin Belousov wrote:
> > On Wed, Feb 25, 2015 at 01:47:55AM -0800, Harrison Grundy wrote:
> >> Three choices here are attached here:
> >> 
> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197922
> >> 
> >> The only remaining one I don't have a patch for is putting a
> >> "real" PRNG in ULE.
> >> 
> >> At this point, as far as ULE goes, It just comes down to picking
> >> from one of those approaches.
> > 
> > The third patch, ' Creates sched_random, using the system used in
> > cpu_search.', seems to miss updating the dpcpu randomval in
> > sched_random(), isn't it ?
> > 
> 
> It does exactly what cpu_search does.
I do not see how it does exactly what cpu_search does.

cpu_search is updating *rndptr:
	rnd = (*rndptr = *rndptr * 69069 + 5) >> 26;

while code in patch is:
+        rndptr = DPCPU_PTR(randomval);
+        rnd = (*rndptr * 69069 + 5) >> 26;

where is the write to *rndptr ?

> 
> I really think the scheduler does not actually need randomness in
> these locations. I've been running for the past few days on a few
> systems here that way for testing purposes without issue.
Why doing the arithmetic then ?

> 
> I'll post a separate call for testers for a patch that overtly removes
> them. ULE has a ton of different methods for balancing load between
> cores (which is why you can turn off the long term balancer entirely).


More information about the freebsd-arch mailing list