2009-06-05 10:59:38

by Igor Zhbanov

[permalink] [raw]
Subject: Can kmalloc( ) with __GFP_WAIT flag fail?

Hello!

Can kmalloc( ) fail when invoked with __GFP_WAIT flag (which is
implied by GFP_KERNEL)?
And for what reason it may fail?

Thanks.


2009-06-05 11:06:20

by Andi Kleen

[permalink] [raw]
Subject: Re: Can kmalloc( ) with __GFP_WAIT flag fail?

Igor Zhbanov <[email protected]> writes:

> Hello!
>
> Can kmalloc( ) fail when invoked with __GFP_WAIT flag (which is
> implied by GFP_KERNEL)?

Yes it can fail.

> And for what reason it may fail?

When the kernel is out of memory.

-Andi
--
[email protected] -- Speaking for myself only.