Re: [patch 1/1] alloc_pages(): permit get_zeroed_page(GFP_ATOMIC) from interrupt context

Christoph Lameter
2007-08-27T21:00:04Z

On Mon, 27 Aug 2007, Andrew Morton wrote:

> > > I think it makes sense to permit a non-BUGging get_zeroed_page(GFP_ATOMIC)
> > > from interrupt context.
> >
> > AFAIK this works now. GFP_ATOMIC does not set __GFP_HIGHMEM and thus the
> > check
> >
> > VM_BUG_ON((gfp_flags & __GFP_HIGHMEM) && in_interrupt());
> >
> > does not trigger
>
> The crash happens in
>
> clear_highpage
> ->kmap_atomic
> ->kmap_atomic_prot
> ->BUG_ON(!pte_none(*(kmap_pte-idx)));
>
> ie: this CPU held a kmap slot when the interrupt happened.

I guess I do not get what the problem is then. AFAIK: You cannot get there
if you do a get_zeroed_page(GFP_ATOMIC). We should have bugged in
get_zeroed_page() before we even got to clear_highpage.