Re: [PATCH,RFC] Add gfp_mask to get_vm_area()

Andrew Morton (akpm@digeo.com)
Mon, 30 Sep 2002 22:08:00 -0700


David Gibson wrote:
>
> Dave, please consider this patch. It renames get_vm_area() to
> __get_vm_area() and adds a gfp_mask parameter which is passed on to
> kmalloc(). get_vm_area(size,flags) is then defined as as
> __get_vm_area(size,flags,GFP_KERNEL) to avoid messing with existing
> callers.
>
> We need this in order to sanely make pci_alloc_consistent() (and other
> consistent allocation functions) obey the DMA-mapping.txt rules on PPC
> embedded machines (specifically the requirement that it be callable
> from interrupt context).
>

I can look after that for you. But I'd prefer that you just add the
extra gfp_flags argument to get_vm_area() and update the 16 callers.

You cannot call get_vm_area() from interrupt context at present;
it does write_lock(&vmlist_lock) unsafely.

It would be a bit sad to make vmlist_lock interrupt-safe for this. Is
there no alternative?

(And what the hell is arch/alpha/mm/init.c:callback_init() doing rewriting
vmlist? Somebody shoot that code)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/