|
|
Message-ID: <20260823214507.GN23438@brightrain.aerifal.cx> Date: Sun, 23 Aug 2026 17:45:07 -0400 From: Rich Felker <dalias@...c.org> To: "Jason A. Donenfeld" <Jason@...c4.com> Cc: Demi Marie Obenour <demiobenour@...il.com>, musl@...ts.openwall.com, Jonas Böttiger <jonasboettiger@...oud.com>, AWilcox@...cox-tech.com Subject: Re: vDSO-based getrandom On Sun, Aug 23, 2026 at 03:12:39PM -0600, Jason A. Donenfeld wrote: > On Sun, Aug 23, 2026, 13:53 Rich Felker <dalias@...c.org> wrote: > > On Sun, Aug 23, 2026 at 03:03:43PM -0400, Demi Marie Obenour wrote: > > > I agree that this would be simpler, but I’m concerned that it could > > > (a) be racy and (b) be a scalability bottleneck. I suspect the vDSO > > > doesn’t guarantee that the atomics used have strong enough memory > > > barriers for multithreaded use. Furthermore, modern server systems > > > can have a very large number of cores and a global lock could be a > > > serious scalability bottleneck. > > > > The strength of the atomics is a good question. If the ones used > > internally are not sufficient you could do the same thing around it > > with full strength atomics. > > > > I don't think allocating an extra page of memory per thread is very > > nice. > > > > It's not a page per thread. You allocate a page (or pages) and divide it > between threads. Thanks for clarifying. So I guess you need to maintain some sort of allocator state for which slots are used/free? Or one could try to make it work with selecting a slot based on getcpu instead of statically assigning them to threads. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.