Commit 6626c5d53bc45c59798628677ba5606f02e371f3

Authored by Andrew Morton
Committed by Linus Torvalds
1 parent 17cf44064a

[PATCH] mm: prep_zero_page() in irq is a bug

prep_zero_page() uses KM_USER0 and hence may not be used from IRQ context, at
least for highmem pages.

Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Christoph Lameter <christoph@lameter.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

... ... @@ -217,6 +217,11 @@
217 217 int i;
218 218  
219 219 BUG_ON((gfp_flags & (__GFP_WAIT | __GFP_HIGHMEM)) == __GFP_HIGHMEM);
  220 + /*
  221 + * clear_highpage() will use KM_USER0, so it's a bug to use __GFP_ZERO
  222 + * and __GFP_HIGHMEM from hard or soft interrupt context.
  223 + */
  224 + BUG_ON((gfp_flags & __GFP_HIGHMEM) && in_interrupt());
220 225 for (i = 0; i < (1 << order); i++)
221 226 clear_highpage(page + i);
222 227 }