Re: kmalloc without GFP_xxx?

Arjan van de Ven
2005-06-29T11:15:48Z

On Wed, 2005-06-29 at 14:02 +0300, Denis Vlasenko wrote:
> Hi,
> It struck me that kernel actually can figure out whether it's okay
> to sleep or not by looking at combination of (flags & __GFP_WAIT)
> and ((in_atomic() || irqs_disabled()) as it already does this for
> might_sleep() barfing:

that is not enough.

you could be holding a spinlock for example!

(and no that doesn't set in_atomic() always)