[PATCH v2] mm gfp_atomic comments

From: Paul Jackson
Date: Tue Jan 10 2006 - 22:20:58 EST


From: Paul Jackson <pj@xxxxxxx>

Clarify in comments that GFP_ATOMIC means both "don't sleep" and "use
emergency pools", hence both ALLOC_HARDER and ALLOC_HIGH.

Signed-off-by: Paul Jackson <pj@xxxxxxx>

---

This is the same patch that Andrew tried sending to Linus
on Jan 6, 2006, except that it has been fixed to refer to
ALLOC_HARDER and ALLOC_HIGH, instead of the other ALLOC_DIP_*
terms that were rejected.

include/linux/gfp.h | 1 +
mm/page_alloc.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)

--- 2.6.15-mm2.orig/include/linux/gfp.h 2006-01-10 13:39:35.831271898 -0800
+++ 2.6.15-mm2/include/linux/gfp.h 2006-01-10 13:59:44.175302966 -0800
@@ -57,6 +57,7 @@ struct vm_area_struct;
__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
__GFP_NOMEMALLOC|__GFP_HARDWALL)

+/* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */
#define GFP_ATOMIC (__GFP_HIGH)
#define GFP_NOIO (__GFP_WAIT)
#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
--- 2.6.15-mm2.orig/mm/page_alloc.c 2006-01-10 13:41:57.345486682 -0800
+++ 2.6.15-mm2/mm/page_alloc.c 2006-01-10 14:07:44.845490827 -0800
@@ -998,7 +998,8 @@ restart:
*
* The caller may dip into page reserves a bit more if the caller
* cannot run direct reclaim, or if the caller has realtime scheduling
- * policy.
+ * policy or is asking for __GFP_HIGH memory. GFP_ATOMIC requests will
+ * set both ALLOC_HARDER (!wait) and ALLOC_HIGH (__GFP_HIGH).
*/
alloc_flags = ALLOC_WMARK_MIN;
if ((unlikely(rt_task(p)) && !in_interrupt()) || !wait)

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/