tech-kern archive

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

Re: allocating memory during kernel startup



On Fri, May 07, 2010 at 03:11:32PM -0400, Michael wrote:
> It's rasops_reconfig(). It may want to autogenerate box drawing
> characters, which needs to allocate memory, but it can happily live
> without them and some ports ( macppc for example ) setup a rasops-
> based console very early in the boot process. In this case
> rasops_reconfig() should simply skip the character generating
> process instead of something nasty like a panic to happen.

How much memory are talking about? If it is small, don't bother. If it
makes the difference between reaching init or not, you won't have much
fun with the system later anyway. If it is large, consider doing it
later e.g. when wscons is initialised and recompute until then.

Pretty much all cases of "alloc may fail here" are either due to being
in interrupt context or due to explicit limits in place (mbufs) or due
to missing limits. Most if not all allocations by drivers etc should be
sleeping and never allowed to fail. Some dead lock detection for before
init is started might be nice, but there isn't really a sane error
handling way.

Joerg


Home | Main Index | Thread Index | Old Index