Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2015 02:23:34 -0800
From:      Harrison Grundy <harrison.grundy@astrodoggroup.com>
To:        freebsd-arch@freebsd.org
Subject:   Re: locks and kernel randomness...
Message-ID:  <54EDA2A6.9080209@astrodoggroup.com>
In-Reply-To: <20150225102113.GD74514@kib.kiev.ua>
References:  <20150224231921.GQ46794@funkthat.com> <1424822522.1328.11.camel@freebsd.org> <20150225002956.GT46794@funkthat.com> <2F49527F-2F58-4BD2-B8BE-1B1190CCD4D0@bsdimp.com> <54ED5656.50607@astrodoggroup.com> <20150225090638.GB74514@kib.kiev.ua> <54ED92E5.4010803@astrodoggroup.com> <54ED9A4B.4060802@astrodoggroup.com> <20150225100512.GC74514@kib.kiev.ua> <54EDA128.4000107@astrodoggroup.com> <20150225102113.GD74514@kib.kiev.ua>

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


On 02/25/15 02:21, Konstantin Belousov wrote:
> 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 ?

My mistake. I'll update the patch accordingly.

Interestingly enough, ULE doesn't seem to care about losing randomness
there either.

--- Harrison



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