[Devel,rh7] mm/tswap: make tswap work again

Submitted by Andrey Ryabinin on April 18, 2017, 2:30 p.m.


Message ID 20170418143045.10868-1-aryabinin@virtuozzo.com
State New
Series "mm/tswap: make tswap work again"
Headers show

Commit Message

Andrey Ryabinin April 18, 2017, 2:30 p.m.
The same issue as with tcache in "mm/tcache: make tcache work again"

Tswap uses PF_MEMALLOC to distinguish memcg recalim from global reclaim,
but sinche upstream commit 89a2848381b5 ("mm: memcontrol: do not recurse
in direct reclaim") this is no longer works as PF_MEMALLOC also set during
memcg reclaim.

Use new PF_MEMCG_RECLAIM instead of PF_MEMALLOC to identify per-memcg
recalim to avoid populating tswap during global reclaim

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 mm/tswap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/mm/tswap.c b/mm/tswap.c
index 4c6c5bc..15f5adc 100644
--- a/mm/tswap.c
+++ b/mm/tswap.c
@@ -288,7 +288,7 @@  static int tswap_frontswap_store(unsigned type, pgoff_t offset,
 	if (cache_page)
 		goto copy;
-	if (current->flags & PF_MEMALLOC)
+	if (!(current->flags & PF_MEMCG_RECLAIM))
 		return -1;
 	cache_page = alloc_page(TSWAP_GFP_MASK | __GFP_HIGHMEM);