Re: [PATCH] Allow __vmalloc with GFP_ATOMIC

From: Russell King
Date: Sat Apr 28 2007 - 03:53:05 EST

On Fri, Apr 27, 2007 at 09:03:33PM -0700, Giridhar Pemmasani wrote:
> Until 2.6.19, __vmalloc with GFP_ATOMIC was possible, but __get_vm_area_node
> would allocate the node itself with GFP_KERNEL, causing a warning. In 2.6.19,
> this was "fixed" by using the same flags that were passed to __vmalloc also
> in __get_vm_area_node. However, __get_vm_area_node does
> BUG_ON(in_interrupt()) now, since vmlist_lock is obtained without disabling
> bottom-half's. The patch below uses bh disabled lock for vmlist_lock, so that
> __vmalloc can be used in interrupt context.

It's worse than that. If vmalloc has to allocate a page table, the
allocation will be done as a non-atomic allocation. So, even if you
do fix __get_vm_area_node and all the other cases, if you hit a page
table allocation you'll still get a warning.

Folk need to accept that using vmalloc from atomic contexts is a
complete nono.

Russell King
Linux kernel 2.6 ARM Linux -
maintainer of:
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at