[Devel] [PATCH RHEL7 COMMIT] mm/tswap: make tswap work again

Konstantin Khorenko khorenko at virtuozzo.com
Tue Apr 18 07:42:02 PDT 2017


The commit is pushed to "branch-rh7-3.10.0-514.16.1.vz7.30.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-514.16.1.vz7.30.3
------>
commit ad6fbf96fe30f323e03b0f872e4eeffacbfbb264
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Tue Apr 18 18:42:01 2017 +0400

    mm/tswap: make tswap work again
    
    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
    
    https://jira.sw.ru/browse/PSBM-64725
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/tswap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);


More information about the Devel mailing list