[PATCH] mm/zswap: unregister zswap_cpu_notifier_block in cleanup procedure

2014-11-09 Thread Mahendran Ganesh
In zswap_cpu_init(), the code does not unregister *zswap_cpu_notifier_block* during the cleanup procedure. This patch fix this issue. Signed-off-by: Mahendran Ganesh --- mm/zswap.c |1 + 1 file changed, 1 insertion(+) diff --git a/mm/zswap.c b/mm/zswap.c index ea064c1..51a2c45 100644

[PATCH] mm/zswap: add __init to some functions in zswap

2014-11-09 Thread Mahendran Ganesh
zswap_cpu_init/zswap_comp_exit/zswap_entry_cache_create is only called by __init init_zswap() Signed-off-by: Mahendran Ganesh --- mm/zswap.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/zswap.c b/mm/zswap.c index 51a2c45..2e621fa 100644 --- a/mm/zswap.c +++ b

[PATCH] mm/zsmalloc: avoid duplicate assignment of prev_class

2014-11-20 Thread Mahendran Ganesh
new size_class structure is allocated. Signed-off-by: Mahendran Ganesh --- mm/zsmalloc.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index b3b57ef..ac2b396 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -970,7 +970,7 @@ struct

[RFC PATCH] mm/zsmalloc: remove unnecessary check

2014-11-20 Thread Mahendran Ganesh
-off-by: Mahendran Ganesh --- mm/zsmalloc.c |2 -- 1 file changed, 2 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index b3b57ef..f2279e2 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -973,8 +973,6 @@ struct zs_pool *zs_create_pool(gfp_t flags) struct size_class

[PATCH] mm/zram: correct ZRAM_ZERO flag bit position

2014-11-12 Thread Mahendran Ganesh
instead of (ZRAM_FLAG_SHIFT + 1). This patch fixes this issue. Also this patch fixes a typo, "page in now accessed" -> "page is now accessed" Signed-off-by: Mahendran Ganesh --- drivers/block/zram/zram_drv.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --g

[PATCH 1/3] mm/zsmalloc: avoid unregister a NOT-registered zsmalloc zpool driver

2014-11-13 Thread Mahendran Ganesh
zs_init() instead of calling zs_exit() where it will unregister a not-registered zpool driver. Signed-off-by: Mahendran Ganesh --- mm/zsmalloc.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 839a48c..3d2bb36 100644 --- a/mm

[PATCH 2/3] mm/zsmalloc: add __init/__exit to zs_init/zs_exit

2014-11-13 Thread Mahendran Ganesh
After patch [1], the zs_exit is only called in module exit. So add __init/__exit to zs_init/zs_exit. [1] mm/zsmalloc: avoid unregister a NOT-registered zsmalloc zpool driver Signed-off-by: Mahendran Ganesh --- mm/zsmalloc.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 3/3] mm/zsmalloc: adjust zs_init/zs_exit location

2014-11-13 Thread Mahendran Ganesh
file which is the common style. [1] mm/zsmalloc: avoid unregister a NOT-registered zsmalloc zpool driver Signed-off-by: Mahendran Ganesh --- mm/zsmalloc.c | 96 - 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/mm

[PATCH v2] mm/zsmalloc: avoid duplicate assignment of prev_class

2014-11-21 Thread Mahendran Ganesh
first class has been allocated. Signed-off-by: Mahendran Ganesh --- v1 -> v2: - follow Dan Streetman's advise to use prev_class to check whether the first class has been allocated - follow Minchan Kim's advise to remove uninitialized_var() --- mm/zsmalloc.c |7 --- 1

[PATCH] mm/zsmalloc: support max obj with length of PAGE_SIZE

2014-11-21 Thread Mahendran Ganesh
LTA) will be less than ZS_MAX_ALLOC_SIZE(page size). And in zs_malloc(), we thought we can put an obj(len == PAGE_SIZE) into zsmalloc. But actually we can not. This will make user confused. This patch takes Minchan Kim's suggestion. https://lkml.org/lkml/2014/11/21/172 When (ZS_MAX_

[PATCH] mm/zsmalloc: remove uninitialized_var

2014-11-24 Thread Mahendran Ganesh
uninitialized_var() is not recommended to be used to avoid compiler warnings https://lkml.org/lkml/2012/10/27/71 So this patch initializes ret with *NOTIFY_OK*. Signed-off-by: Mahendran Ganesh --- mm/zsmalloc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm

[PATCH] mm/zsmalloc: support allocating obj with size of ZS_MAX_ALLOC_SIZE

2014-11-24 Thread Mahendran Ganesh
uffer with size ZS_MAX_ALLOC_SIZE. Then the max obj(size is ZS_MAX_ALLOC_SIZE) can be stored in it. Signed-off-by: Mahendran Ganesh Suggested-by: Minchan Kim --- mm/zsmalloc.c | 40 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/mm/