]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: huge_memory: use GFP_TRANSHUGE when charging huge pages
authorJohannes Weiner <hannes@cmpxchg.org>
Thu, 26 Jun 2014 00:42:36 +0000 (10:42 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 26 Jun 2014 00:42:36 +0000 (10:42 +1000)
commit6913750fec854bb788064a8a70416063c544d644
tree5233b4604b0b23ee229480607c99a2c7464ccf6c
parent375e7d44c9d65f6351e654f0aa3adc7f6aba703b
mm: huge_memory: use GFP_TRANSHUGE when charging huge pages

Transparent huge page charges prefer falling back to regular pages rather
than spending a lot of time in direct reclaim.

Desired reclaim behavior is usually declared in the gfp mask, but THP
charges use GFP_KERNEL and then rely on the fact that OOM is disabled for
THP charges, and that OOM-disabled charges don't retry reclaim.  Needless
to say, this is anything but obvious and quite error prone.

Convert THP charges to use GFP_TRANSHUGE instead, which implies
__GFP_NORETRY, to indicate the low-latency requirement.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: Hugh Dickins <hughd@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vladimir Davydov <vdavydov@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c