tech-kern archive

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

Re: allocating memory during kernel startup


Michael <> wrote:
> I recently ran into this problem - there is no easy way to determine  
> wether it is safe to call kmem_alloc() yet ( as in, are we far enough  
> through startup ) and when we call it too early the whole thing just  
> hangs.
> 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".

It would be great to abstract and structure entire init_main.c into
something rational one day.  However, this is not trivial...


Home | Main Index | Thread Index | Old Index