From: 黄涛 Date: Mon, 19 Sep 2011 04:04:27 +0000 (+0800) Subject: mm: add _GFP_NO_KSWAPD flag X-Git-Tag: firefly_0821_release~9767^2~25^2~4 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6befb4f40fdcb1c64296cfbcda8d3526b847b2a9;p=firefly-linux-kernel-4.4.55.git mm: add _GFP_NO_KSWAPD flag commit 32dba98e085f8b2b4345887df9abf5e0e93bfc12 upstream. --- diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 557bdad320b6..64d72e58f8e0 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -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 */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e1881454831f..033218c33378 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -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