aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-09 17:31:50 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-09 17:31:50 -0800
commitca4b75dc601129bfcd50892357e411d3decbaaab (patch)
tree60162ab75b116a3da7a195019c5add92591255c7 /mm
parentaafeed4acb2307b07383ed70e781c091cccf3ddd (diff)
downloadhistory-ca4b75dc601129bfcd50892357e411d3decbaaab.tar.gz
Make it clear that GFP_ZERO does not work with atomic highmem allocations.
We use a non-atomic kmap() to clear the page, which cannot be used from atomic contexts.
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4afaf20f03b306..74b5700093b52a 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -591,19 +591,20 @@ void fastcall free_cold_page(struct page *page)
free_hot_cold_page(page, 1);
}
-/*
- * Really, prep_compound_page() should be called from __rmqueue_bulk(). But
- * we cheat by calling it from here, in the order > 0 path. Saves a branch
- * or two.
- */
-static inline void prep_zero_page(struct page *page, int order)
+static inline void prep_zero_page(struct page *page, int order, int gfp_flags)
{
int i;
+ BUG_ON((gfp_flags & (__GFP_WAIT | __GFP_HIGHMEM)) == __GFP_HIGHMEM);
for(i = 0; i < (1 << order); i++)
clear_highpage(page + i);
}
+/*
+ * Really, prep_compound_page() should be called from __rmqueue_bulk(). But
+ * we cheat by calling it from here, in the order > 0 path. Saves a branch
+ * or two.
+ */
static struct page *
buffered_rmqueue(struct zone *zone, int order, int gfp_flags)
{
@@ -640,7 +641,7 @@ buffered_rmqueue(struct zone *zone, int order, int gfp_flags)
prep_new_page(page, order);
if (gfp_flags & __GFP_ZERO)
- prep_zero_page(page, order);
+ prep_zero_page(page, order, gfp_flags);
if (order && (gfp_flags & __GFP_COMP))
prep_compound_page(page, order);