Date: Fri, 6 Jul 2012 03:19:04 +0400 From: Andrey Chernov <ache@FreeBSD.ORG> To: Pawel Jakub Dawidek <pjd@FreeBSD.ORG> Cc: src-committers@FreeBSD.ORG, John Baldwin <jhb@FreeBSD.ORG>, svn-src-all@FreeBSD.ORG, David Chisnall <theraven@FreeBSD.ORG>, Attilio Rao <attilio@FreeBSD.ORG>, Konstantin Belousov <kostikbel@gmail.com>, svn-src-head@FreeBSD.ORG, markm@FreeBSD.ORG Subject: Re: svn commit: r238118 - head/lib/libc/gen Message-ID: <20120705231903.GA76664@vniz.net> In-Reply-To: <20120705213901.GA1442@garage.freebsd.pl> References: <201207041951.q64JpPXu029310@svn.freebsd.org> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> <CAJ-FndAGgkgi5W3LqgMkeK9AquQ=1RhhYcj4jnLmuRg2EwVuqA@mail.gmail.com> <201207050749.43210.jhb@freebsd.org> <20120705213901.GA1442@garage.freebsd.pl>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Thu, Jul 05, 2012 at 11:39:02PM +0200, Pawel Jakub Dawidek wrote: > > sysctls are not all Giant locked. KERN_ARND is marked MPSAFE, so it does not > > use Giant: > > It doesn't really matter. Our in-kernel random generator has its own > giant lock, so is basically single threaded. Compare results of those > two on some SMP machine: > > # dd if=/dev/random of=/dev/null bs=1m count=1024 > > # sh -c 'for i in `jot $(sysctl -n hw.ncpu)`; do dd if=/dev/random of=/dev/null bs=1m count=128 & done' It doesn't really matter for KERN_ARND because it is rarely reseeded and consume most of its time on internal arc4 permutations. That is why strong KERN_ARND seeding after boot is required (currently it is very weak and easily guessed as I already mention) - started right after boot applications all suffers from weak seeding up to the next rare KERN_ARND and arc4random() both reseeds.. -- http://ache.vniz.net/ [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk/2IOcACgkQVg5YK5ZEdN2XRgCgtyIYXuY50eyxAojhXAhdPI7x te4AnA7zICkZ6S95V3wRl0nM9BubhrSO =fHc7 -----END PGP SIGNATURE-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120705231903.GA76664>
