tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: allocating memory during kernel startup



Michael <macallan%netbsd.org@localhost> wrote:
> >> Any chance to just have kmem_alloc() immediately return NULL if it
> >> isn't ready yet so we can fail gracefully instead of hanging?
> >
> > Such handling, i.e. in kmem(9), seems like a wrong approach to me.
> >
> > Caller can check the 'cold' variable, which is unset in configure2().
> > Although it does not clearly define what condition is "non-cold".
> 
> We get out of cold WAY later than that. In fact kmem is ready before  
> autoconfig starts and cold is only cleared after that.

Well, kmem(9) is initialised very early, just after pool(9), in uvm_init(),
where I moved it couple years ago.  Yes, 'cold' is unset very late.  Since
allocation gets postponed anyway, is that a problem?  You did not describe
your use case. :)

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index