On Fri, Dec 11, 2015 at 11:00:06AM -0500, Christos Zoulas wrote: > Fixing kmem_alloc() and friends not to fail under certain conditions might > be possible, but it could lead to livelock scenarios where everything is > stuck in the kernel waiting for resources to be freed. > > Perhaps we should just explain that it is not the responsibility of the > caller to check for the result of kmem_alloc() in the KM_WAIT case, and > centralize the check in kmem_alloc() to make it panic() if it would > return NULL? Is that better than fixing the 400+ calling sites?
I haven't looked see exactly what the internal conditions are that lead to kmem_alloc(KM_SLEEP) returning NULL, so it's not clear whether having kmem_alloc() retry or panic in that situation would be better. but either of those would be better than adding code to all the callers. -Chuck
