[RFC] Should lmb_alloc() always panic on failure?

Michael Ellerman michael at ellerman.id.au
Wed Dec 7 10:39:03 EST 2005


Hi ya'll,

Currently lmb_alloc(_base) returns 0 if it can't allocate memory, but a lot of 
places don't actualyl check. I was thinking it might be better if it just 
panicked.

The following functions call lmb_alloc() and don't check the return value:

finish_device_tree()
rtas_initialize()
irqstack_early_init()
emergency_stack_init()
early_get_page()
MMU_init_hw()
stabs_alloc()
pmac_probe()
alloc_u3_dart_table()

These functions check and panic() or BUG_ON:

unflatten_device_tree()
htab_initialize()
do_init_bootmem()
dart_init()

The only other caller is careful_allocation(), which checks and retries the 
alloc with different parameters - we could accomodate this with an 
__lmb_alloc() or similar.

What do people think?

cheers

-- 
Michael Ellerman
IBM OzLabs

email: michael:ellerman.id.au
inmsg: mpe:jabber.org
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20051206/8d9d7159/attachment.pgp 


More information about the Linuxppc64-dev mailing list