Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jul 2015 19:29:19 +0100
From:      Mark R V Murray <markm@FreeBSD.org>
To:        Ian Lepore <ian@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r284959 - in head: . share/man/man4 share/man/man9 sys/conf sys/dev/glxsb sys/dev/hifn sys/dev/random sys/dev/rndtest sys/dev/safe sys/dev/syscons sys/dev/ubsec sys/dev/virtio/random sy...
Message-ID:  <87D9CCA8-B77F-4CBD-85EC-08C4A9D8413E@FreeBSD.org>
In-Reply-To: <1437055729.1334.359.camel@freebsd.org>
References:  <201506301700.t5UH0jPq001498@svn.freebsd.org> <CAJ-VmomjDvkH7R-fhSbjFwj2XzNt4Z67aSKt-LRvvRTeVi2EPQ@mail.gmail.com> <6FF99E82-AE79-4112-8EB9-DC35B75F498D@FreeBSD.org> <1437055729.1334.359.camel@freebsd.org>

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

> On 16 Jul 2015, at 15:08, Ian Lepore <ian@FreeBSD.org> wrote:
>=20
> On Thu, 2015-07-16 at 06:39 +0100, Mark Murray wrote:
>>> On 15 Jul 2015, at 23:43, Adrian Chadd <adrian.chadd@gmail.com> =
wrote:
>>>=20
>>>> - Add harvesting of slab allocator events. This needs to be checked =
for
>>>>   weighing down the allocator code.
>>>=20
>>> Hi,
>>>=20
>>> Is this really doing it upon every one of those events? eg, for each
>>> mbuf alloc through UMA?
>>=20
>> Only if you turn it on!
>>=20
>> M
>>=20
>=20
> In random_harvestq_init() I see
>=20
> harvest_context.hc_source_mask =3D RANDOM_HARVEST_EVERYTHING_MASK;
>=20
> and
>=20
> #define RANDOM_HARVEST_EVERYTHING_MASK ((1 << =
(RANDOM_ENVIRONMENTAL_END
> + 1)) - 1)
>=20
> So doesn't that include the RANDOM_FAST flag that controls harvesting
> during every UMA alloc and free call?  And that harvesting appears to =
be
> anything but fast, at least at a glance... it looks like it passes the
> entire struct uma_zone to the jenkins hash function... is there really
> useful entropy in all the data in that struct?

Well spotted, but fear not. All sources are on at startup, and this
is to ensure that the generator has maximal access to entropy while
booting.

One of the default duties of etc/rc.d/random is to turn off the UMA
and ATIME sources. These may be turned on if you want them, but by
default on the fully booted system they are off.

See =E2=80=98sysctl kern.random.harvest.mask_symbolic=E2=80=99 and note =
that the
disabled sources are in [].

I have yet to do a full set of benchmarks, but I have discussed
this with RWatson. A silly benchmark (make world) shows little
effect, but I will be doing this properly in coming months.

In answer to you final question - yes. The UMA entropy is a bit
spread out, but it is good.

M
--=20
Mark R V Murray




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87D9CCA8-B77F-4CBD-85EC-08C4A9D8413E>