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

Andrew Morton
2007-08-27T22:11:07Z

On Mon, 27 Aug 2007 14:43:46 -0700 (PDT)
Christoph Lameter <clameter@sgi.com> wrote:

> On Mon, 27 Aug 2007, Andrew Morton wrote:
>
> > > Move the check for highmem to the beginning of the function? Why
> > > should kmap_atomic fail for a non highmem page?
> >
> > For test coverage, mainly. If someone is testing highmem-enabled code on
> > a 512MB machine, we want them to get told about any highmem-handling bugs,
> > even though they don't have highmem.
>
> But the test is for nested kmap_atomics.

Sure. If process-context code uses KM_USER0 and then an interrupt occurs
and interrupt-level code uses KM_USER0, Ingo's test will go boom.

> Nesting (at least allocate a
> regular page while highmem page is being mapped) needs to work in order to
> be able to allocate a page from an interrupt contexts.

yup, but interrupt-level code should use the reserved-for-interrupt kmap
slots (KM_IRQ0, etc).