mm: add _GFP_NO_KSWAPD flag
author黄涛 <huangtao@rock-chips.com>
Mon, 19 Sep 2011 04:04:27 +0000 (12:04 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 19 Sep 2011 04:06:46 +0000 (12:06 +0800)
commit 32dba98e085f8b2b4345887df9abf5e0e93bfc12 upstream.

include/linux/gfp.h
mm/page_alloc.c

index 557bdad320b624369441119e5f352ccbd41b04a6..64d72e58f8e0dd3e3dc39a35415a75d9e7d22dc2 100644 (file)
@@ -59,13 +59,15 @@ struct vm_area_struct;
 #define __GFP_NOTRACK  ((__force gfp_t)0)
 #endif
 
+#define __GFP_NO_KSWAPD        ((__force gfp_t)0x400000u)
+
 /*
  * This may seem redundant, but it's a way of annotating false positives vs.
  * allocations that simply cannot be supported (e.g. page tables).
  */
 #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
 
-#define __GFP_BITS_SHIFT 22    /* Room for 22 __GFP_FOO bits */
+#define __GFP_BITS_SHIFT 23    /* Room for 23 __GFP_FOO bits */
 #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
 
 /* This equals 0, but use constants in case they ever change */
index e1881454831f892f4639834a7285d0d2e164de0d..033218c333784f2afd366b8bc5acf19aa5f6b9f7 100644 (file)
@@ -1833,7 +1833,8 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
                goto nopage;
 
 restart:
-       wake_all_kswapd(order, zonelist, high_zoneidx);
+       if (!(gfp_mask & __GFP_NO_KSWAPD))
+               wake_all_kswapd(order, zonelist, high_zoneidx);
 
        /*
         * OK, we're below the kswapd watermark and have kicked background