[Devel] [PATCH RHEL7 COMMIT] mm: transcendent swap cache

Konstantin Khorenko khorenko at odin.com
Tue Apr 28 06:33:12 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.el7.ovz.4.8
------>
commit dd56dcc8aa7e8b2426d94309d1b199e9ca40a9e9
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Tue Apr 28 17:32:00 2015 +0400

    mm: transcendent swap cache
    
    Transcendent swap cache (tswap) is a simple driver for frontswap, which
    stores reclaimed pages in memory unmodified. Its purpose is to adopt
    pages evicted from a memory cgroup on local pressure, so that they can
    be fetched back later without costly disk accesses. It works similarly
    to shadow gangs from PCS6 except pages has to be copied on eviction.
    
    Tswap pages are reclaimed on global pressure in the LRU order using the
    shrinker API. Upon eviction a tswap page is copied back to the swap
    cache and writeback is initiated.
    
    * Usage
    
     - To enable the frontswap backend, pass tswap.enabled=1 at boot.
     - To activate/deactivate tswap, write Y/N to
       /sys/module/tswap/parameters/active
     - To get the number of pages cached, read
       /sys/module/tswap/parameters/nr_pages
    
    https://jira.sw.ru/browse/PSBM-32063
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 config.OpenVZ |  1 +
 mm/Kconfig    | 10 ++++++++++
 mm/Makefile   |  1 +
 3 files changed, 12 insertions(+)

diff --git a/config.OpenVZ b/config.OpenVZ
index 7275b27..250b85d 100644
--- a/config.OpenVZ
+++ b/config.OpenVZ
@@ -5290,6 +5290,7 @@ CONFIG_HAVE_ARCH_SOFT_DIRTY=y
 CONFIG_MEM_SOFT_DIRTY=y
 
 CONFIG_TCACHE=y
+CONFIG_TSWAP=y
 
 #
 # User resources
diff --git a/mm/Kconfig b/mm/Kconfig
index d91c9a6..e3c7f58 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -531,3 +531,13 @@ config TCACHE
 	  stores reclaimed pages in memory without any modifications. It is
 	  only worth enabling if used along with memory cgroups in order to
 	  cache pages which were reclaimed on local pressure.
+
+config TSWAP
+	bool "Transcendent swap cache"
+	depends on FRONTSWAP
+	default n
+	help
+	  Transcendent swap cache is a simple backend for frontswap, which
+	  stores reclaimed pages in memory without any modifications. It is
+	  only worth enabling if used along with memory cgroups in order to
+	  cache pages which were reclaimed on local pressure.
diff --git a/mm/Makefile b/mm/Makefile
index a9b1f75..cb994a6 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -62,3 +62,4 @@ obj-$(CONFIG_CLEANCACHE) += cleancache.o
 obj-$(CONFIG_MEMORY_ISOLATION) += page_isolation.o
 obj-$(CONFIG_ZBUD)	+= zbud.o
 obj-$(CONFIG_TCACHE) += tcache.o
+obj-$(CONFIG_TSWAP) += tswap.o



More information about the Devel mailing list