From: David Rientjes Date: Wed, 30 Jul 2014 23:08:24 +0000 (-0700) Subject: mm, thp: do not allow thp faults to avoid cpuset restrictions X-Git-Tag: upstream/snapshot3+hdmi~1940 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e7598322f418926b9aa3d814e2c88ae7995fa61a;hp=e7598322f418926b9aa3d814e2c88ae7995fa61a;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git mm, thp: do not allow thp faults to avoid cpuset restrictions commit b104a35d32025ca740539db2808aa3385d0f30eb upstream. The page allocator relies on __GFP_WAIT to determine if ALLOC_CPUSET should be set in allocflags. ALLOC_CPUSET controls if a page allocation should be restricted only to the set of allowed cpuset mems. Transparent hugepages clears __GFP_WAIT when defrag is disabled to prevent the fault path from using memory compaction or direct reclaim. Thus, it is unfairly able to allocate outside of its cpuset mems restriction as a side-effect. This patch ensures that ALLOC_CPUSET is only cleared when the gfp mask is truly GFP_ATOMIC by verifying it is also not a thp allocation. Signed-off-by: David Rientjes Reported-by: Alex Thorlton Tested-by: Alex Thorlton Cc: Bob Liu Cc: Dave Hansen Cc: Hedi Berriche Cc: Hugh Dickins Cc: Johannes Weiner Cc: Kirill A. Shutemov Cc: Mel Gorman Cc: Rik van Riel Cc: Srivatsa S. Bhat Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman ---