[Devel] [PATCH RHEL7 COMMIT] tswap: enable exclusive gets

Konstantin Khorenko khorenko at virtuozzo.com
Mon Jun 22 02:37:55 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.15
------>
commit 4c42a827be4b165d0371b67353aae3427628c74e
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Mon Jun 22 13:37:55 2015 +0400

    tswap: enable exclusive gets
    
    Patchset description:
    
    Patches 1 and 2 fix memory corruption caused by tswap:
      https://jira.sw.ru/browse/PSBM-34269
    Patch 5 fixes pinning a page in tswap.
    Patch 7 fixes indefinitely long stalls during tswap reclaim.
    Patch 3, 4, and 6 do cleanup.
    
    Vladimir Davydov (6):
      tswap: enable exclusive gets
      tswap: do not allocate a page on store if there is already one
      tswap: introduce tswap_delete_page helper
      tswap: shrink tswap page if swapcache page is uptodate
      tswap: use global lock to protect lru lists
      tswap: do not writeback pages on reclaim
    
    Weijie Yang (1):
      mm: frontswap: invalidate expired data on a dup-store failure
    
    ###############################################################
    This patch description:
    
    By default, a frontswap backend is supposed to keep a loaded page in the
    transcendent storage, but tswap invalidates loaded pages. As a result,
    after a successful load we get an uptodate clean swapcache page that has
    not been written to disk. This can result in userspace memory
    corruption.
    
    In case of tswap, there is no point in keeping loaded pages - it will
    only double memory consumption, so we must force frontswap frontend to
    dirty a page after loading it from backend.
    
    https://jira.sw.ru/browse/PSBM-34269
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 mm/tswap.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/tswap.c b/mm/tswap.c
index 6f87073..f2c450f 100644
--- a/mm/tswap.c
+++ b/mm/tswap.c
@@ -329,6 +329,8 @@ static int __init tswap_init(void)
 	if (err)
 		goto out_free_lru;
 
+	frontswap_tmem_exclusive_gets(true);
+
 	old_ops = frontswap_register_ops(&tswap_frontswap_ops);
 	pr_info("tswap loaded\n");
 	if (old_ops)



More information about the Devel mailing list