lkml.org 
[lkml]   [2015]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/3] Make /dev/urandom scalable
> > +{
> > + struct entropy_store *pool = &nonblocking_pool;
> > +
> > + /*
> > + * Non node 0 pools may take longer to initialize. Keep using
> > + * the boot nonblocking pool while this happens.
> > + */
> > + if (nonblocking_node_pool)
> > + pool = nonblocking_node_pool[numa_node_id()];
> > + if (!pool->initialized)
> > + pool = &nonblocking_pool;
> > + return pool;
> > +}
>
> I assume this can't get called concurrently with rand_initialize
> (otherwise pool may be NULL even if nonblocking_node_pool is non-NULL).

Yes. I can move the assignment to the global last and add a memory
barrier.

> > + char name[40];
> > +
> > + nonblocking_node_pool = kzalloc(num_nodes * sizeof(void *),
> > + GFP_KERNEL|__GFP_NOFAIL);
> > +
>
> Why kzalloc, when you immediately initialize all elements? New uses of
> __GFP_NOFAIL seem to be frowned upon. How hard would it be to just fall
> back to only using the single statically allocated pool?

It's already doing that.

>
> Does rand_initialize get called before or after other initialization
> code updates node_possible_map to reflect the actual possible number of
> nodes? If before, won't we be wasting a lot of memory (not to mention
> that we then might as well allocate all the nonblocking pools statically
> based on MAX_NUMNODES).

I'll check.

-Andi
--
ak@linux.intel.com -- Speaking for myself only.


\
 
 \ /
  Last update: 2015-09-24 00:01    [W:0.121 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site