From: John Byrne <john.byrne@hp...> - 2005-04-28 18:53:51
Aneesh Kumar wrote:
> Is this ok ?
Well, it looks to me that you don't need the loop with the __GFP_NOFAIL
flag; so the only reason it should fail is that the request is too
large. I think I'd do it more like ths:
static inline void * kmalloc_nofail(size_t size)
p = kmalloc(size, GFP_KERNEL|__GFP_NOFAIL);
panic("%s: failed! size %ld too large?\n", (long)size)
I've never been happy about the KMALLOC_NOFAIL_MAX constant.
What do you think?