Re: [RFC] SL[AUO]B common code 5/9] slabs: Common definition for boot state of the slab allocators

Christoph Lameter
2012-05-17T14:16:30Z

On Thu, 17 May 2012, Glauber Costa wrote:

> > Why can this processing not be done when sysfs has just been initialized?
>
> If we can be 100 % sure that idr/ida is always initialized before sysfs, than
> yes, we can.

idr_init_cache() is run even before kmem_cache_init_late(). Have a look at
init/main.c. No need to muck with the bootup sequence.

> > The reason to use == is because we want things to happen only at a
> > particular stage of things. The == SYSFS means we will only do an action
> > if the slab system is fully functional. Such things will have to be
> > reevaluated if the number of states change.
>
> Yes, but you are actually arguing in my favor. "fully functional" means >=
> SYSFS, not == SYSFS.

That is only true if you add another state.

> If for whatever reordering people may decide doing another state is added, or
> this function is called later, that will fail

Then the assumptions that SYSFS is the final state is no longer true and
therefore the code needs to be inspected if this change affects anything.