* Re: [PATCH v2 0/3] promote zcache from staging
2012-09-04 20:02 [PATCH v2 0/3] promote zcache from staging Seth Jennings
@ 2012-09-04 19:57 ` Konrad Rzeszutek Wilk
2012-09-04 20:11 ` Andrew Morton
2012-09-04 20:11 ` Seth Jennings
2012-09-04 20:02 ` [PATCH v2 1/3] zsmalloc: promote to mm/ Seth Jennings
` (2 subsequent siblings)
3 siblings, 2 replies; 7+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-09-04 19:57 UTC (permalink / raw)
To: Seth Jennings
Cc: Greg Kroah-Hartman, Andrew Morton, Nitin Gupta, Minchan Kim,
Dan Magenheimer, Xiao Guangrong, Robert Jennings, linux-mm,
linux-kernel, devel
On Tue, Sep 04, 2012 at 03:02:46PM -0500, Seth Jennings wrote:
> zcache is the remaining piece of code required to support in-kernel
> memory compression. The other two features, cleancache and frontswap,
> have been promoted to mainline in 3.0 and 3.5 respectively. This
> patchset promotes zcache from the staging tree to mainline.
Could you please post it as a singular path. As if it was out-off-tree?
That way it will be much easier to review it by looking at the full code.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/3] promote zcache from staging
2012-09-04 19:57 ` Konrad Rzeszutek Wilk
@ 2012-09-04 20:11 ` Andrew Morton
2012-09-04 20:11 ` Seth Jennings
1 sibling, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2012-09-04 20:11 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Seth Jennings, Greg Kroah-Hartman, Nitin Gupta, Minchan Kim,
Dan Magenheimer, Xiao Guangrong, Robert Jennings, linux-mm,
linux-kernel, devel
On Tue, 4 Sep 2012 15:57:11 -0400
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> On Tue, Sep 04, 2012 at 03:02:46PM -0500, Seth Jennings wrote:
> > zcache is the remaining piece of code required to support in-kernel
> > memory compression. The other two features, cleancache and frontswap,
> > have been promoted to mainline in 3.0 and 3.5 respectively. This
> > patchset promotes zcache from the staging tree to mainline.
>
> Could you please post it as a singular path. As if it was out-off-tree?
> That way it will be much easier to review it by looking at the full code.
Yes please. Very few of the MM developers are familiar with this code.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/3] promote zcache from staging
2012-09-04 19:57 ` Konrad Rzeszutek Wilk
2012-09-04 20:11 ` Andrew Morton
@ 2012-09-04 20:11 ` Seth Jennings
1 sibling, 0 replies; 7+ messages in thread
From: Seth Jennings @ 2012-09-04 20:11 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Greg Kroah-Hartman, Andrew Morton, Nitin Gupta, Minchan Kim,
Dan Magenheimer, Xiao Guangrong, Robert Jennings, linux-mm,
linux-kernel, devel
On 09/04/2012 02:57 PM, Konrad Rzeszutek Wilk wrote:
> On Tue, Sep 04, 2012 at 03:02:46PM -0500, Seth Jennings wrote:
>> zcache is the remaining piece of code required to support in-kernel
>> memory compression. The other two features, cleancache and frontswap,
>> have been promoted to mainline in 3.0 and 3.5 respectively. This
>> patchset promotes zcache from the staging tree to mainline.
>
> Could you please post it as a singular path. As if it was out-off-tree?
> That way it will be much easier to review it by looking at the full code.
Ah yes, my bad. Scratch v2. Nothing to see here.
Seth
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/3] zsmalloc: promote to mm/
2012-09-04 20:02 [PATCH v2 0/3] promote zcache from staging Seth Jennings
2012-09-04 19:57 ` Konrad Rzeszutek Wilk
@ 2012-09-04 20:02 ` Seth Jennings
2012-09-04 20:02 ` [PATCH v2 2/3] drivers: add memory management driver class Seth Jennings
2012-09-04 20:02 ` [PATCH v2 3/3] zcache: promote to drivers/mm/ Seth Jennings
3 siblings, 0 replies; 7+ messages in thread
From: Seth Jennings @ 2012-09-04 20:02 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Seth Jennings, Andrew Morton, Nitin Gupta, Minchan Kim,
Konrad Rzeszutek Wilk, Dan Magenheimer, Xiao Guangrong,
Robert Jennings, linux-mm, linux-kernel, devel
This patch promotes the slab-based zsmalloc memory allocator
from the staging tree to mm/
zcache depends on this allocator for storing compressed RAM pages
in an efficient way under system wide memory pressure where
high-order (greater than 0) page allocation are very likely to
fail.
For more information on zsmalloc and its internals, read the
documentation at the top of the zsmalloc c file.
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
---
drivers/staging/Kconfig | 2 --
drivers/staging/Makefile | 1 -
drivers/staging/zcache/zcache-main.c | 4 ++--
drivers/staging/zram/zram_drv.h | 3 +--
drivers/staging/zsmalloc/Kconfig | 10 ----------
drivers/staging/zsmalloc/Makefile | 3 ---
.../staging/zsmalloc => include/linux}/zsmalloc.h | 0
mm/Kconfig | 18 ++++++++++++++++++
mm/Makefile | 1 +
.../zsmalloc/zsmalloc-main.c => mm/zsmalloc.c | 3 +--
10 files changed, 23 insertions(+), 22 deletions(-)
delete mode 100644 drivers/staging/zsmalloc/Kconfig
delete mode 100644 drivers/staging/zsmalloc/Makefile
rename {drivers/staging/zsmalloc => include/linux}/zsmalloc.h (100%)
rename drivers/staging/zsmalloc/zsmalloc-main.c => mm/zsmalloc.c (99%)
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index e3402d5..b7f7bc7 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -78,8 +78,6 @@ source "drivers/staging/zram/Kconfig"
source "drivers/staging/zcache/Kconfig"
-source "drivers/staging/zsmalloc/Kconfig"
-
source "drivers/staging/wlags49_h2/Kconfig"
source "drivers/staging/wlags49_h25/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 3be59d0..ad74bee 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_DX_SEP) += sep/
obj-$(CONFIG_IIO) += iio/
obj-$(CONFIG_ZRAM) += zram/
obj-$(CONFIG_ZCACHE) += zcache/
-obj-$(CONFIG_ZSMALLOC) += zsmalloc/
obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/
obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/
obj-$(CONFIG_FB_SM7XX) += sm7xxfb/
diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c
index 52b43b7..34b2c5c 100644
--- a/drivers/staging/zcache/zcache-main.c
+++ b/drivers/staging/zcache/zcache-main.c
@@ -32,9 +32,9 @@
#include <linux/crypto.h>
#include <linux/string.h>
#include <linux/idr.h>
-#include "tmem.h"
+#include <linux/zsmalloc.h>
-#include "../zsmalloc/zsmalloc.h"
+#include "tmem.h"
#ifdef CONFIG_CLEANCACHE
#include <linux/cleancache.h>
diff --git a/drivers/staging/zram/zram_drv.h b/drivers/staging/zram/zram_drv.h
index 572c0b1..f6d0925 100644
--- a/drivers/staging/zram/zram_drv.h
+++ b/drivers/staging/zram/zram_drv.h
@@ -17,8 +17,7 @@
#include <linux/spinlock.h>
#include <linux/mutex.h>
-
-#include "../zsmalloc/zsmalloc.h"
+#include <linux/zsmalloc.h>
/*
* Some arbitrary value. This is just to catch
diff --git a/drivers/staging/zsmalloc/Kconfig b/drivers/staging/zsmalloc/Kconfig
deleted file mode 100644
index 9084565..0000000
--- a/drivers/staging/zsmalloc/Kconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-config ZSMALLOC
- tristate "Memory allocator for compressed pages"
- default n
- help
- zsmalloc is a slab-based memory allocator designed to store
- compressed RAM pages. zsmalloc uses virtual memory mapping
- in order to reduce fragmentation. However, this results in a
- non-standard allocator interface where a handle, not a pointer, is
- returned by an alloc(). This handle must be mapped in order to
- access the allocated space.
diff --git a/drivers/staging/zsmalloc/Makefile b/drivers/staging/zsmalloc/Makefile
deleted file mode 100644
index b134848..0000000
--- a/drivers/staging/zsmalloc/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-zsmalloc-y := zsmalloc-main.o
-
-obj-$(CONFIG_ZSMALLOC) += zsmalloc.o
diff --git a/drivers/staging/zsmalloc/zsmalloc.h b/include/linux/zsmalloc.h
similarity index 100%
rename from drivers/staging/zsmalloc/zsmalloc.h
rename to include/linux/zsmalloc.h
diff --git a/mm/Kconfig b/mm/Kconfig
index d5c8019..2586b66 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -411,3 +411,21 @@ config FRONTSWAP
and swap data is stored as normal on the matching swap device.
If unsure, say Y to enable frontswap.
+
+config ZSMALLOC
+ tristate "Memory allocator for compressed pages"
+ default n
+ help
+ zsmalloc is a slab-based memory allocator designed to store
+ compressed RAM pages. zsmalloc uses a memory pool that combines
+ single pages into higher order pages by linking them together
+ using the fields of the struct page. Allocations are then
+ mapped through copy buffers or VM mapping, in order to reduce
+ memory pool fragmentation and increase allocation success rate under
+ memory pressure.
+
+ This results in a non-standard allocator interface where
+ a handle, not a pointer, is returned by the allocation function.
+ This handle must be mapped in order to access the allocated space.
+
+ If unsure, say N.
diff --git a/mm/Makefile b/mm/Makefile
index 92753e2..8a3d7bea 100644
--- a/mm/Makefile
+++ b/mm/Makefile
@@ -57,3 +57,4 @@ obj-$(CONFIG_DEBUG_KMEMLEAK) += kmemleak.o
obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o
obj-$(CONFIG_CLEANCACHE) += cleancache.o
obj-$(CONFIG_MEMORY_ISOLATION) += page_isolation.o
+obj-$(CONFIG_ZSMALLOC) += zsmalloc.o
diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/mm/zsmalloc.c
similarity index 99%
rename from drivers/staging/zsmalloc/zsmalloc-main.c
rename to mm/zsmalloc.c
index 09a9d35..6b20429 100644
--- a/drivers/staging/zsmalloc/zsmalloc-main.c
+++ b/mm/zsmalloc.c
@@ -78,8 +78,7 @@
#include <linux/hardirq.h>
#include <linux/spinlock.h>
#include <linux/types.h>
-
-#include "zsmalloc.h"
+#include <linux/zsmalloc.h>
/*
* This must be power of 2 and greater than of equal to sizeof(link_free).
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] drivers: add memory management driver class
2012-09-04 20:02 [PATCH v2 0/3] promote zcache from staging Seth Jennings
2012-09-04 19:57 ` Konrad Rzeszutek Wilk
2012-09-04 20:02 ` [PATCH v2 1/3] zsmalloc: promote to mm/ Seth Jennings
@ 2012-09-04 20:02 ` Seth Jennings
2012-09-04 20:02 ` [PATCH v2 3/3] zcache: promote to drivers/mm/ Seth Jennings
3 siblings, 0 replies; 7+ messages in thread
From: Seth Jennings @ 2012-09-04 20:02 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Seth Jennings, Andrew Morton, Nitin Gupta, Minchan Kim,
Konrad Rzeszutek Wilk, Dan Magenheimer, Xiao Guangrong,
Robert Jennings, linux-mm, linux-kernel, devel
This patchset creates a new driver class under drivers/ for
memory management related drivers, like zcache.
This driver class would be for drivers that don't actually enabled
a hardware device, but rather augment the memory manager in some
way.
In-tree candidates for this driver class are zcache, zram, and
lowmemorykiller, both in staging.
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
---
drivers/Kconfig | 2 ++
drivers/Makefile | 1 +
drivers/mm/Kconfig | 3 +++
3 files changed, 6 insertions(+)
create mode 100644 drivers/mm/Kconfig
diff --git a/drivers/Kconfig b/drivers/Kconfig
index 324e958..d126132 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -154,4 +154,6 @@ source "drivers/vme/Kconfig"
source "drivers/pwm/Kconfig"
+source "drivers/mm/Kconfig"
+
endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index d64a0f7..aa69e1c 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -140,3 +140,4 @@ obj-$(CONFIG_EXTCON) += extcon/
obj-$(CONFIG_MEMORY) += memory/
obj-$(CONFIG_IIO) += iio/
obj-$(CONFIG_VME_BUS) += vme/
+obj-$(CONFIG_MM_DRIVERS) += mm/
diff --git a/drivers/mm/Kconfig b/drivers/mm/Kconfig
new file mode 100644
index 0000000..e5b3743
--- /dev/null
+++ b/drivers/mm/Kconfig
@@ -0,0 +1,3 @@
+menu "Memory management drivers"
+
+endmenu
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] zcache: promote to drivers/mm/
2012-09-04 20:02 [PATCH v2 0/3] promote zcache from staging Seth Jennings
` (2 preceding siblings ...)
2012-09-04 20:02 ` [PATCH v2 2/3] drivers: add memory management driver class Seth Jennings
@ 2012-09-04 20:02 ` Seth Jennings
3 siblings, 0 replies; 7+ messages in thread
From: Seth Jennings @ 2012-09-04 20:02 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Seth Jennings, Andrew Morton, Nitin Gupta, Minchan Kim,
Konrad Rzeszutek Wilk, Dan Magenheimer, Xiao Guangrong,
Robert Jennings, linux-mm, linux-kernel, devel
This patchset promotes the zcache driver from staging to drivers/mm/.
zcache captures swap pages via frontswap and pages that fall
out of the page cache via cleancache and compress them in RAM,
providing a compressed RAM swap and a compressed second-chance
page cache.
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
---
drivers/mm/Kconfig | 10 ++++++++++
drivers/mm/Makefile | 1 +
drivers/{staging => mm}/zcache/Makefile | 0
drivers/{staging => mm}/zcache/tmem.c | 0
drivers/{staging => mm}/zcache/tmem.h | 0
drivers/{staging => mm}/zcache/zcache-main.c | 0
drivers/staging/Kconfig | 2 --
drivers/staging/Makefile | 1 -
drivers/staging/zcache/Kconfig | 11 -----------
9 files changed, 11 insertions(+), 14 deletions(-)
create mode 100644 drivers/mm/Makefile
rename drivers/{staging => mm}/zcache/Makefile (100%)
rename drivers/{staging => mm}/zcache/tmem.c (100%)
rename drivers/{staging => mm}/zcache/tmem.h (100%)
rename drivers/{staging => mm}/zcache/zcache-main.c (100%)
delete mode 100644 drivers/staging/zcache/Kconfig
diff --git a/drivers/mm/Kconfig b/drivers/mm/Kconfig
index e5b3743..22289c6 100644
--- a/drivers/mm/Kconfig
+++ b/drivers/mm/Kconfig
@@ -1,3 +1,13 @@
menu "Memory management drivers"
+config ZCACHE
+ bool "Dynamic compression of swap pages and clean pagecache pages"
+ depends on (CLEANCACHE || FRONTSWAP) && CRYPTO=y && ZSMALLOC=y
+ select CRYPTO_LZO
+ default n
+ help
+ Zcache uses compression and an in-kernel implementation of
+ transcendent memory to store clean page cache pages and swap
+ in RAM, providing a noticeable reduction in disk I/O.
+
endmenu
diff --git a/drivers/mm/Makefile b/drivers/mm/Makefile
new file mode 100644
index 0000000..f36f509
--- /dev/null
+++ b/drivers/mm/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_ZCACHE) += zcache/
diff --git a/drivers/staging/zcache/Makefile b/drivers/mm/zcache/Makefile
similarity index 100%
rename from drivers/staging/zcache/Makefile
rename to drivers/mm/zcache/Makefile
diff --git a/drivers/staging/zcache/tmem.c b/drivers/mm/zcache/tmem.c
similarity index 100%
rename from drivers/staging/zcache/tmem.c
rename to drivers/mm/zcache/tmem.c
diff --git a/drivers/staging/zcache/tmem.h b/drivers/mm/zcache/tmem.h
similarity index 100%
rename from drivers/staging/zcache/tmem.h
rename to drivers/mm/zcache/tmem.h
diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/mm/zcache/zcache-main.c
similarity index 100%
rename from drivers/staging/zcache/zcache-main.c
rename to drivers/mm/zcache/zcache-main.c
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index b7f7bc7..0940d2e 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -76,8 +76,6 @@ source "drivers/staging/iio/Kconfig"
source "drivers/staging/zram/Kconfig"
-source "drivers/staging/zcache/Kconfig"
-
source "drivers/staging/wlags49_h2/Kconfig"
source "drivers/staging/wlags49_h25/Kconfig"
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index ad74bee..6e1c491 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -33,7 +33,6 @@ obj-$(CONFIG_IPACK_BUS) += ipack/
obj-$(CONFIG_DX_SEP) += sep/
obj-$(CONFIG_IIO) += iio/
obj-$(CONFIG_ZRAM) += zram/
-obj-$(CONFIG_ZCACHE) += zcache/
obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/
obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/
obj-$(CONFIG_FB_SM7XX) += sm7xxfb/
diff --git a/drivers/staging/zcache/Kconfig b/drivers/staging/zcache/Kconfig
deleted file mode 100644
index 4881839..0000000
--- a/drivers/staging/zcache/Kconfig
+++ /dev/null
@@ -1,11 +0,0 @@
-config ZCACHE
- bool "Dynamic compression of swap pages and clean pagecache pages"
- depends on (CLEANCACHE || FRONTSWAP) && CRYPTO=y && ZSMALLOC=y
- select CRYPTO_LZO
- default n
- help
- Zcache doubles RAM efficiency while providing a significant
- performance boosts on many workloads. Zcache uses
- compression and an in-kernel implementation of transcendent
- memory to store clean page cache pages and swap in RAM,
- providing a noticeable reduction in disk I/O.
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread