mm: add _GFP_NO_KSWAPD flag

commit 32dba98e08 upstream.
This commit is contained in:
黄涛 2011-09-19 12:04:27 +08:00
parent 7c557888c9
commit 6befb4f40f
2 changed files with 5 additions and 2 deletions

View 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 */

View 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