Re: kmalloc without GFP_xxx?

Jens Axboe
2005-06-29T11:14:54Z

On Wed, Jun 29 2005, Denis Vlasenko wrote:
> So why can't we have kmalloc_auto(size) which does GFP_KERNEL alloc
> if called from non-atomic context and GFP_ATOMIC one otherwise?

Because it's a lot better in generel if we force people to think about
what they are doing wrt memory allocations. You should know if you are
able to block or not, a lot of functions exported require you to have
this knowledge anyways. Adding these auto-detection type functions
encourages bad programming, imho.

--
Jens Axboe