Explorar o código

[PATCH] mm: gfp_atomic comments

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@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Paul Jackson %!s(int64=19) %!d(string=hai) anos
pai
achega
4eac915d02
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 1 0
      include/linux/gfp.h
  2. 2 1
      mm/page_alloc.c

+ 1 - 0
include/linux/gfp.h

@@ -57,6 +57,7 @@ struct vm_area_struct;
 			__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
 			__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
 			__GFP_NOMEMALLOC|__GFP_HARDWALL)
 			__GFP_NOMEMALLOC|__GFP_HARDWALL)
 
 
+/* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */
 #define GFP_ATOMIC	(__GFP_HIGH)
 #define GFP_ATOMIC	(__GFP_HIGH)
 #define GFP_NOIO	(__GFP_WAIT)
 #define GFP_NOIO	(__GFP_WAIT)
 #define GFP_NOFS	(__GFP_WAIT | __GFP_IO)
 #define GFP_NOFS	(__GFP_WAIT | __GFP_IO)

+ 2 - 1
mm/page_alloc.c

@@ -931,7 +931,8 @@ restart:
 	 *
 	 *
 	 * The caller may dip into page reserves a bit more if the caller
 	 * The caller may dip into page reserves a bit more if the caller
 	 * cannot run direct reclaim, or if the caller has realtime scheduling
 	 * 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;
 	alloc_flags = ALLOC_WMARK_MIN;
 	if ((unlikely(rt_task(p)) && !in_interrupt()) || !wait)
 	if ((unlikely(rt_task(p)) && !in_interrupt()) || !wait)