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

2014-11-20 Thread Ganesh Mahendran
Hello 2014-11-21 11:22 GMT+08:00 Dan Streetman ddstr...@ieee.org: On Thu, Nov 20, 2014 at 8:08 AM, Mahendran Ganesh opensource.gan...@gmail.com wrote: In zs_create_pool(), prev_class is assigned (ZS_SIZE_CLASSES - 1) times. And the prev_class only references to the previous alloc size_class.

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

2014-11-20 Thread Ganesh Mahendran
Hello 2014-11-21 11:43 GMT+08:00 Minchan Kim minc...@kernel.org: On Thu, Nov 20, 2014 at 09:08:33PM +0800, Mahendran Ganesh wrote: In zs_create_pool(), prev_class is assigned (ZS_SIZE_CLASSES - 1) times. And the prev_class only references to the previous alloc size_class. So we do not need

Re: [RFC PATCH] mm/zsmalloc: remove unnecessary check

2014-11-20 Thread Ganesh Mahendran
Hello 2014-11-21 11:54 GMT+08:00 Minchan Kim minc...@kernel.org: On Thu, Nov 20, 2014 at 09:21:56PM +0800, Mahendran Ganesh wrote: ZS_SIZE_CLASSES is calc by: ((ZS_MAX_ALLOC_SIZE - ZS_MIN_ALLOC_SIZE) / ZS_SIZE_CLASS_DELTA + 1) So when i is in [0, ZS_SIZE_CLASSES - 1), the size: size =

Re: [RFC PATCH] mm/zsmalloc: remove unnecessary check

2014-11-21 Thread Ganesh Mahendran
Hello Minchan 2014-11-21 18:32 GMT+08:00 Minchan Kim minc...@kernel.org: On Fri, Nov 21, 2014 at 06:48:49AM +, Minchan Kim wrote: On Fri, Nov 21, 2014 at 01:33:26PM +0800, Ganesh Mahendran wrote: Hello 2014-11-21 11:54 GMT+08:00 Minchan Kim minc...@kernel.org: On Thu, Nov 20, 2014

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

2014-11-13 Thread Ganesh Mahendran
2014-11-13 8:02 GMT+08:00 Minchan Kim minc...@kernel.org: On Wed, Nov 12, 2014 at 10:37:18PM +0800, Mahendran Ganesh wrote: In struct zram_table_entry, the element *value* contains obj size and obj zram flags. Bit 0 to bit (ZRAM_FLAG_SHIFT - 1) represent obj size, and bit ZRAM_FLAG_SHIFT to

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

2014-11-13 Thread Ganesh Mahendran
2014-11-13 9:27 GMT+08:00 Weijie Yang weijie.y...@samsung.com: On Thu, Nov 13, 2014 at 8:02 AM, Minchan Kim minc...@kernel.org wrote: On Wed, Nov 12, 2014 at 10:37:18PM +0800, Mahendran Ganesh wrote: In struct zram_table_entry, the element *value* contains obj size and obj zram flags. Bit 0 to

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

2014-11-13 Thread Ganesh Mahendran
2014-11-13 10:53 GMT+08:00 Seth Jennings sjenni...@variantweb.net: On Sun, Nov 09, 2014 at 07:22:23PM +0800, Mahendran Ganesh wrote: In zswap_cpu_init(), the code does not unregister *zswap_cpu_notifier_block* during the cleanup procedure. This is not needed. If we are in the cleanup code,

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

2014-11-13 Thread Ganesh Mahendran
2014-11-13 10:55 GMT+08:00 Seth Jennings sjenni...@variantweb.net: On Sun, Nov 09, 2014 at 08:23:52PM +0800, Mahendran Ganesh wrote: zswap_cpu_init/zswap_comp_exit/zswap_entry_cache_create is only called by __init init_zswap() Thanks for the cleanup! Acked-by: Seth Jennings

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

2014-11-13 Thread Ganesh Mahendran
Hello 2014-11-13 23:22 GMT+08:00 Sergey Senozhatsky sergey.senozhat...@gmail.com: On (11/13/14 21:37), Mahendran Ganesh wrote: Now zsmalloc can be registered as a zpool driver into zpool when CONFIG_ZPOOL is enabled. During the init of zsmalloc, when error happens, we need to do cleanup. But

Re: [PATCH v2] mm/zsmalloc: add statistics support

2014-12-22 Thread Ganesh Mahendran
Hello Minchan 2014-12-20 10:25 GMT+08:00 Minchan Kim minc...@kernel.org: Hey Ganesh, On Sat, Dec 20, 2014 at 09:43:34AM +0800, Ganesh Mahendran wrote: 2014-12-20 8:23 GMT+08:00 Minchan Kim minc...@kernel.org: On Fri, Dec 19, 2014 at 04:17:56PM -0800, Andrew Morton wrote: On Sat, 20 Dec

[PATCH 1/2] mm/zpool: add name argument to create zpool

2014-12-26 Thread Ganesh Mahendran
is to use a name passed by caller(such as zram) to create the zsmalloc pool. /sys/kernel/debug/zsmalloc/zram0 This patch adds a argument *name* to zs_create_pool() and other related functions. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com --- drivers/block/zram/zram_drv.c |8

[PATCH 2/2] mm/zsmalloc: add statistics support

2014-12-26 Thread Ganesh Mahendran
. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Suggested-by: Minchan Kim minc...@kernel.org Cc: Nitin Gupta ngu...@vflare.org --- mm/Kconfig| 10 +++ mm/zsmalloc.c | 244 - 2 files changed, 250 insertions(+), 4 deletions

[PATCH V2 1/2] mm/zpool: add name argument to create zpool

2014-12-29 Thread Ganesh Mahendran
is to use a name passed by caller(such as zram) to create the zsmalloc pool. /sys/kernel/debug/zsmalloc/zram0 This patch adds a argument *name* to zs_create_pool() and other related functions. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Cc: Seth Jennings sjenni

[PATCH V2 2/2] mm/zsmalloc: add statistics support

2014-12-29 Thread Ganesh Mahendran
. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Suggested-by: Minchan Kim minc...@kernel.org Cc: Nitin Gupta ngu...@vflare.org Acked-by: Minchan Kim minc...@kernel.org --- Change in V2: use array in struct zs_size_stat -- Minchan --- mm/Kconfig| 10 +++ mm/zsmalloc.c | 233

Re: [PATCH V2 2/2] mm/zsmalloc: add statistics support

2014-12-29 Thread Ganesh Mahendran
Sorry, Please ignore this patch. I miss something. 2014-12-29 20:28 GMT+08:00 Ganesh Mahendran opensource.gan...@gmail.com: Keeping fragmentation of zsmalloc in a low level is our target. But now we still need to add the debug code in zsmalloc to get the quantitative data. This patch adds

[PATCH V2 2/2] mm/zsmalloc: add statistics support

2014-12-29 Thread Ganesh Mahendran
. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Suggested-by: Minchan Kim minc...@kernel.org Cc: Nitin Gupta ngu...@vflare.org Acked-by: Minchan Kim minc...@kernel.org --- Change in V2: use array in struct zs_size_stat -- Minchan add name argument in zs_pool_stat_create when

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

2014-11-25 Thread Ganesh Mahendran
the first class has been allocated. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Cc: Minchan Kim minc...@kernel.org Cc: Nitin Gupta ngu...@vflare.org Cc: Dan Streetman ddstr...@ieee.org --- v1 - v2: - follow Dan Streetman's advise to use prev_class to check whether the first class

[PATCH] fs/debugfs: add get/set for atomic_long types

2014-12-11 Thread Ganesh Mahendran
debugfs currently can not create attributes that set/get atomic_long_t values. This patch adds support for this through a new debugfs_create_atomic_long_t() function. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com --- fs/debugfs/file.c | 45

Re: [PATCH] fs/debugfs: add get/set for atomic_long types

2014-12-11 Thread Ganesh Mahendran
Hello Greg: 2014-12-11 22:45 GMT+08:00 Greg KH gre...@linuxfoundation.org: On Thu, Dec 11, 2014 at 08:47:10PM +0800, Ganesh Mahendran wrote: debugfs currently can not create attributes that set/get atomic_long_t values. This patch adds support for this through a new

Re: [PATCH] mm/zsmalloc: disclose statistics to debugfs

2014-12-11 Thread Ganesh Mahendran
Hello Minchan 2014-12-12 7:40 GMT+08:00 Minchan Kim minc...@kernel.org: Hello Ganesh, On Wed, Dec 10, 2014 at 09:40:20PM +0800, Ganesh Mahendran wrote: As we now talk more and more about the fragmentation of zsmalloc. But we still need to manually add some debug code to see the fragmentation

Re: [PATCH] mm/zsmalloc: disclose statistics to debugfs

2014-12-11 Thread Ganesh Mahendran
2014-12-12 14:40 GMT+08:00 Minchan Kim minc...@kernel.org: On Fri, Dec 12, 2014 at 01:53:16PM +0800, Ganesh Mahendran wrote: Hello Minchan 2014-12-12 7:40 GMT+08:00 Minchan Kim minc...@kernel.org: Hello Ganesh, On Wed, Dec 10, 2014 at 09:40:20PM +0800, Ganesh Mahendran wrote: As we now

[PATCH 1/2] mm/zsmalloc: adjust order of functions

2014-12-13 Thread Ganesh Mahendran
, this patch ajusts function sequence as: /* helper functions */ ... obj_location_to_handle() ... /* Some exported functions */ ... zs_map_object() zs_unmap_object() zs_malloc() zs_free() zs_init() zs_exit() Signed-off-by: Ganesh Mahendran

[PATCH 2/2] mm/zsmalloc: add statistics support

2014-12-13 Thread Ganesh Mahendran
low fragmentation: Most of the objects is in class 254 with size 4096 Bytes. The pages in zspage is 1. And there is only one object in a page. So, No fragmentation will be produced. Also we can collect other information and show it to user in the future. Signed-off-by: Ganesh Mahendran

Re: [PATCH] zsmalloc: correct fragile [kmap|kunmap]_atomic use

2014-11-16 Thread Ganesh Mahendran
Hello 2014-11-14 9:11 GMT+08:00 Minchan Kim minc...@kernel.org: The kunmap_atomic should use virtual address getting by kmap_atomic. However, some pieces of code in zsmalloc uses modified address, not the one got by kmap_atomic for kunmap_atomic. It's okay for working because zsmalloc

[PATCH] zram: use DEVICE_ATTR_[RW|RO|WO] to define zram sys device attribute

2014-12-03 Thread Ganesh Mahendran
defined macro DEVICE_ATTR_[RW|RO|WO] to define zram device attribute. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com --- drivers/block/zram/zram_drv.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b

Re: [PATCH 2/2] mm/zsmalloc: add statistics support

2014-12-18 Thread Ganesh Mahendran
Hello, Minchan 2014-12-19 7:44 GMT+08:00 Minchan Kim minc...@kernel.org: Hello Ganesh, On Wed, Dec 17, 2014 at 03:05:19PM +0800, Ganesh Mahendran wrote: Hello, Minchan Thanks for your review. 2014-12-16 10:45 GMT+08:00 Minchan Kim minc...@kernel.org: On Sat, Dec 13, 2014 at 09:45:14PM

Re: [PATCH 2/2] mm/zsmalloc: add statistics support

2014-12-18 Thread Ganesh Mahendran
2014-12-19 9:30 GMT+08:00 Minchan Kim minc...@kernel.org: On Fri, Dec 19, 2014 at 09:21:52AM +0800, Ganesh Mahendran wrote: Hello, Minchan 2014-12-19 7:44 GMT+08:00 Minchan Kim minc...@kernel.org: Hello Ganesh, On Wed, Dec 17, 2014 at 03:05:19PM +0800, Ganesh Mahendran wrote: Hello

[PATCH v2] mm/zsmalloc: add statistics support

2014-12-19 Thread Ganesh Mahendran
. User can call it to get the zs pool index after zs pool is populated. And you can collect other zsmalloc statistics as you need and analyse them. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Suggested-by: Minchan Kim minc...@kernel.org Cc: Nitin Gupta ngu...@vflare.org --- V1 - V2

Re: [PATCH v2] mm/zsmalloc: add statistics support

2014-12-19 Thread Ganesh Mahendran
Hello Andrew, Thanks for your review. 2014-12-20 6:32 GMT+08:00 Andrew Morton a...@linux-foundation.org: On Fri, 19 Dec 2014 20:55:19 +0800 Ganesh Mahendran opensource.gan...@gmail.com wrote: Keeping fragmentation of zsmalloc in a low level is our target. But now we still need to add

Re: [PATCH v2] mm/zsmalloc: add statistics support

2014-12-19 Thread Ganesh Mahendran
2014-12-20 8:23 GMT+08:00 Minchan Kim minc...@kernel.org: On Fri, Dec 19, 2014 at 04:17:56PM -0800, Andrew Morton wrote: On Sat, 20 Dec 2014 09:10:43 +0900 Minchan Kim minc...@kernel.org wrote: It involves rehashing a lengthy argument with Greg. Okay. Then, Ganesh, please add warn

Re: [PATCH 1/2] mm/zsmalloc: adjust order of functions

2014-12-15 Thread Ganesh Mahendran
Hello Minchan, 2014-12-16 8:40 GMT+08:00 Minchan Kim minc...@kernel.org: Hello Ganesh, On Sat, Dec 13, 2014 at 09:43:23PM +0800, Ganesh Mahendran wrote: Currently functions in zsmalloc.c does not arranged in a readable and reasonable sequence. With the more and more functions added, we may

Re: [PATCH 2/2] mm/zsmalloc: add statistics support

2014-12-16 Thread Ganesh Mahendran
Hello, Minchan Thanks for your review. 2014-12-16 10:45 GMT+08:00 Minchan Kim minc...@kernel.org: On Sat, Dec 13, 2014 at 09:45:14PM +0800, Ganesh Mahendran wrote: As a ram based memory allocator, keep the fragmentation in a low level Just say, zsmalloc. Ok. is our target. But now we

Re: [RFC 0/6] zsmalloc support compaction

2014-12-17 Thread Ganesh Mahendran
2014-12-18 7:19 GMT+08:00 Seth Jennings sjenni...@variantweb.net: On Tue, Dec 02, 2014 at 11:49:41AM +0900, Minchan Kim wrote: Recently, there was issue about zsmalloc fragmentation and I got a report from Juno that new fork failed although there are plenty of free pages in the system. His

[RFC PATCH] mm/zsmalloc: allocate exactly size of struct zs_pool

2014-11-29 Thread Ganesh Mahendran
In zs_create_pool(), we allocate memory more then sizeof(struct zs_pool) ovhd_size = roundup(sizeof(*pool), PAGE_SIZE); This patch allocate memory of exactly needed size. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com --- mm/zsmalloc.c |5 ++--- 1 file changed, 2 insertions

[PATCH] mm/zsmalloc: disclose statistics to debugfs

2014-12-10 Thread Ganesh Mahendran
can collect other information and add corresponding entries in debugfs when needed. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com --- mm/zsmalloc.c | 108 ++--- 1 file changed, 104 insertions(+), 4 deletions(-) diff --git a/mm

Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration when freeing size_class

2015-02-02 Thread Ganesh Mahendran
Hello Minchan: 2015-02-02 9:09 GMT+08:00 Minchan Kim minc...@kernel.org: Hello Ganesh, On Sat, Jan 31, 2015 at 04:59:58PM +0800, Ganesh Mahendran wrote: ping. 2015-01-24 21:50 GMT+08:00 Ganesh Mahendran opensource.gan...@gmail.com: The pool-size_class[i] is assigned with the i from

Re: [PATCH] zram: fix umount-reset_store-mount race condition

2015-02-03 Thread Ganesh Mahendran
Hello, Sergey 2015-02-02 22:08 GMT+08:00 Sergey Senozhatsky sergey.senozhat...@gmail.com: Ganesh Mahendran was the first one who proposed to use bdev-bd_mutex to avoid -bd_holders race condition: CPU0CPU1 umount /* zram-init_done is true */ reset_store

Re: [PATCH] mm/zsmalloc: add log for module load/unload

2015-01-26 Thread Ganesh Mahendran
Hello, Andrew 2015-01-27 7:19 GMT+08:00 Andrew Morton a...@linux-foundation.org: On Sat, 24 Jan 2015 21:48:41 +0800 Ganesh Mahendran opensource.gan...@gmail.com wrote: Sometimes, we want to know whether a module is loaded or unloaded from the log. Why? What's special about zsmalloc

Re: [PATCH] zram: free meta table in zram_meta_free

2015-01-26 Thread Ganesh Mahendran
Hello, Minchan 2015-01-26 23:45 GMT+08:00 Minchan Kim minc...@kernel.org: Hello, On Sat, Jan 24, 2015 at 09:45:53PM +0800, Ganesh Mahendran wrote: zram_meta_alloc() and zram_meta_free() are a pair. In zram_meta_alloc(), meta table is allocated. So it it better to free it in zram_meta_free

[PATCH v2] zram: free meta table in zram_meta_free

2015-01-28 Thread Ganesh Mahendran
zram_meta_alloc() and zram_meta_free() are a pair. In zram_meta_alloc(), meta table is allocated. So it it better to free it in zram_meta_free(). Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Cc: Nitin Gupta ngu...@vflare.org Cc: Minchan Kim minc...@kernel.org Cc: Sergey Senozhatsky

Re: [PATCH 1/2] zram: free meta table in zram_meta_free

2015-01-28 Thread Ganesh Mahendran
it it better to free it in zram_meta_free(). Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Signed-off-by: Minchan Kim minc...@kernel.org --- drivers/block/zram/zram_drv.c | 30 ++ drivers/block/zram/zram_drv.h | 1 + 2 files changed, 15 insertions

Re: [PATCH v1 2/2] zram: remove init_lock in zram_make_request

2015-01-29 Thread Ganesh Mahendran
Hello, Minchan: 2015-01-28 16:15 GMT+08:00 Minchan Kim minc...@kernel.org: Admin could reset zram during I/O operation going on so we have used zram-init_lock as read-side lock in I/O path to prevent sudden zram meta freeing. When I/O operation is running, that means the /dev/zram0 is mounted

Re: [PATCH] zram: fix race between reset and mount/mkswap

2015-01-31 Thread Ganesh Mahendran
Please ignore this. Sorry for the noise. 2015-01-31 16:25 GMT+08:00 Ganesh Mahendran opensource.gan...@gmail.com: Currently there is a racy between reset and mount/mkswap, so that it could make oops when umount a corropted filesystem. This issue can be reproduced by adding delay between bdput

[PATCH] zram: fix race between reset and mount/mkswap

2015-01-31 Thread Ganesh Mahendran
-off-by: Ganesh Mahendran opensource.gan...@gmail.com Cc: Nitin Gupta ngu...@vflare.org Cc: Minchan Kim minc...@kernel.org Cc: Sergey Senozhatsky sergey.senozhat...@gmail.com --- drivers/block/zram/zram_drv.c | 79 ++--- 1 file changed, 42 insertions(+), 37

Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration when freeing size_class

2015-01-31 Thread Ganesh Mahendran
ping. 2015-01-24 21:50 GMT+08:00 Ganesh Mahendran opensource.gan...@gmail.com: The pool-size_class[i] is assigned with the i from (zs_size_classes - 1) to 0. So if we failed in zs_create_pool(), we only need to iterate from (zs_size_classes - 1) to i, instead of from 0 to (zs_size_classes

Re: [PATCH v1 2/2] zram: remove init_lock in zram_make_request

2015-01-31 Thread Ganesh Mahendran
2015-01-30 16:08 GMT+08:00 Sergey Senozhatsky sergey.senozhatsky.w...@gmail.com: On (01/30/15 15:52), Ganesh Mahendran wrote: When I/O operation is running, that means the /dev/zram0 is mounted or swaped on. Then the device could not be reset by below code: /* Do not reset an active

[PATCH] zram: free meta table in zram_meta_free

2015-01-24 Thread Ganesh Mahendran
zram_meta_alloc() and zram_meta_free() are a pair. In zram_meta_alloc(), meta table is allocated. So it it better to free it in zram_meta_free(). Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Cc: Nitin Gupta ngu...@vflare.org Cc: Minchan Kim minc...@kernel.org --- drivers/block

Re: [PATCH 2/2] zram: protect zram-stat race with init_lock

2015-01-24 Thread Ganesh Mahendran
Hello Sergey 2015-01-23 22:38 GMT+08:00 Sergey Senozhatsky sergey.senozhat...@gmail.com: On (01/23/15 14:58), Minchan Kim wrote: The zram-stat handling should be procted by init_lock. Otherwise, user could see stale value from the stat. Signed-off-by: Minchan Kim minc...@kernel.org --- I

[PATCH] mm/zsmalloc: avoid unnecessary iteration when freeing size_class

2015-01-24 Thread Ganesh Mahendran
The pool-size_class[i] is assigned with the i from (zs_size_classes - 1) to 0. So if we failed in zs_create_pool(), we only need to iterate from (zs_size_classes - 1) to i, instead of from 0 to (zs_size_classes - 1) Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Cc: Nitin Gupta ngu

[PATCH] mm/zsmalloc: add log for module load/unload

2015-01-24 Thread Ganesh Mahendran
Sometimes, we want to know whether a module is loaded or unloaded from the log. This patch adds some log. Signed-off-by: Ganesh Mahendran opensource.gan...@gmail.com Cc: Nitin Gupta ngu...@vflare.org Cc: Minchan Kim minc...@kernel.org --- mm/zsmalloc.c |7 +++ 1 file changed, 7

Re: [PATCH v1 2/2] zram: remove init_lock in zram_make_request

2015-01-31 Thread Ganesh Mahendran
Hello, Sergey 2015-01-31 19:07 GMT+08:00 Sergey Senozhatsky sergey.senozhat...@gmail.com: On (01/31/15 16:50), Ganesh Mahendran wrote: after umount we still have init device. so, *theoretically*, we can see something like CPU0CPU1 umount

Re: [PATCH v1 02/10] zsmalloc: decouple handle and object

2015-01-25 Thread Ganesh Mahendran
Hello, Minchan 2015-01-21 14:14 GMT+08:00 Minchan Kim minc...@kernel.org: Currently, zram's handle encodes object's location directly so it makes hard to support migration/compaction. This patch decouples handle and object via adding indirect layer. For it, it allocates handle dynamically

Re: [PATCH v1 2/2] zram: remove init_lock in zram_make_request

2015-01-29 Thread Ganesh Mahendran
Hello Sergey 2015-01-29 23:12 GMT+08:00 Sergey Senozhatsky sergey.senozhat...@gmail.com: On (01/29/15 21:48), Ganesh Mahendran wrote: Admin could reset zram during I/O operation going on so we have used zram-init_lock as read-side lock in I/O path to prevent sudden zram meta freeing

[PATCH] mm/zsmalloc: add trace events for zs_compact

2016-06-07 Thread Ganesh Mahendran
226.928575: zsmalloc_compact_end: pool zram0: 250 pages compacted(total 2106) - Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- include/trace/events/zsmalloc.h | 56 + mm/zsmalloc.c

Re: [PATCH] mm/zsmalloc: add trace events for zs_compact

2016-06-07 Thread Ganesh Mahendran
Hi, Minchan: 2016-06-08 8:16 GMT+08:00 Minchan Kim <minc...@kernel.org>: > Hello Ganesh, > > On Tue, Jun 07, 2016 at 04:56:44PM +0800, Ganesh Mahendran wrote: >> Currently zsmalloc is widely used in android device. >> Sometimes, we want to see how frequently zs_compact

Re: [PATCH] mm/zsmalloc: add trace events for zs_compact

2016-06-08 Thread Ganesh Mahendran
Hi, Minchan: 2016-06-08 13:13 GMT+08:00 Minchan Kim <minc...@kernel.org>: > On Wed, Jun 08, 2016 at 09:48:30AM +0800, Ganesh Mahendran wrote: >> Hi, Minchan: >> >> 2016-06-08 8:16 GMT+08:00 Minchan Kim <minc...@kernel.org>: >> > Hello Ganesh, >>

Re: [PATCH] mm/zsmalloc: add trace events for zs_compact

2016-06-12 Thread Ganesh Mahendran
2016-06-13 12:42 GMT+08:00 Minchan Kim <minc...@kernel.org>: > On Wed, Jun 08, 2016 at 02:39:19PM +0800, Ganesh Mahendran wrote: > > > >> zsmalloc is not only used by zram, but also zswap. Maybe >> others in the future. >> >> I tried to use funct

Re: [PATCH] mm/zsmalloc: add trace events for zs_compact

2016-06-12 Thread Ganesh Mahendran
Hi, Sergey: 2016-06-08 22:10 GMT+08:00 Sergey Senozhatsky <sergey.senozhat...@gmail.com>: > Hello, > > On (06/08/16 14:39), Ganesh Mahendran wrote: >> >> > On Tue, Jun 07, 2016 at 04:56:44PM +0800, Ganesh Mahendran wrote: >> >> >> Cur

Re: [PATCH] mm/zsmalloc: add trace events for zs_compact

2016-06-13 Thread Ganesh Mahendran
2016-06-13 13:12 GMT+08:00 Sergey Senozhatsky : > Hello, > > On (06/13/16 13:42), Minchan Kim wrote: > [..] >> > compacted(total 0) */ >> > 2) # 1351.241 us | } >> > -- >> > => 1351.241 us used >> > >> > And it seems the overhead of function_graph is bigger

[PATCH v2] mm/page_alloc: remove unnecessary order check in __alloc_pages_direct_compact

2016-06-15 Thread Ganesh Mahendran
In the callee try_to_compact_pages(), the (order == 0) is checked, so remove check in __alloc_pages_direct_compact. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- v2: remove the check in __alloc_pages_direct_compact - Anshuman Khandual --- mm/page_alloc.c | 3 ---

[PATCH] mm/compaction: remove unnecessary order check in try_to_compact_pages()

2016-06-15 Thread Ganesh Mahendran
The caller __alloc_pages_direct_compact() already check (order == 0). So no need to check again. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- mm/compaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/compaction.c b/mm/compaction.c index f

Re: [PATCH 2/3] staging: lowmemorykiller: count anon pages only when we have swap devices

2016-06-21 Thread Ganesh Mahendran
Hi, David: On Tue, Jun 21, 2016 at 01:22:00PM -0700, David Rientjes wrote: > On Tue, 21 Jun 2016, Ganesh Mahendran wrote: > > > lowmem_count() should only count anon pages when we have swap device. > > > > Why? I make a mistake. I thought lowmem_count will re

Re: [PATCH 1/3] staging: lowmemorykiller: change lowmem_adj to lowmem_score_adj

2016-06-21 Thread Ganesh Mahendran
Hi, David: On Tue, Jun 21, 2016 at 01:27:40PM -0700, David Rientjes wrote: > On Tue, 21 Jun 2016, Ganesh Mahendran wrote: > > > om_adj is deprecated, and in lowmemorykiller module, we use score adj > > to do the comparing. > > --- > > oom_score_

Re: [PATCH 3/3] staging: lowmemorykiller: select the task with maximum rss to kill

2016-06-21 Thread Ganesh Mahendran
Hi, David: On Tue, Jun 21, 2016 at 01:14:36PM -0700, David Rientjes wrote: > On Tue, 21 Jun 2016, Ganesh Mahendran wrote: > > > Current task selecting logic in LMK does not fully aware of the memory > > pressure. It may select the task with maximum score adj, but with

[PATCH] mm/compaction: remove local variable is_lru

2016-06-17 Thread Ganesh Mahendran
check. So there is no need to use local variable is_lru. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- mm/compaction.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/compaction.c b/mm/compaction.c index fbb7b38..780be7f 100644 --- a/mm/compa

[PATCH 1/3] staging: lowmemorykiller: change lowmem_adj to lowmem_score_adj

2016-06-20 Thread Ganesh Mahendran
continue; } --- This patch makes the variable name consistent with the usage. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- drivers/staging/android/lowmemorykiller.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/

[PATCH 3/3] staging: lowmemorykiller: select the task with maximum rss to kill

2016-06-20 Thread Ganesh Mahendran
, tasksize 1M Current LMK logic will select *task b*. But now the system already have much memory pressure. We should select the task with maximum task from all the tasks which score adj >= min_score_adj. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- drivers/stagin

[PATCH 2/3] staging: lowmemorykiller: count anon pages only when we have swap devices

2016-06-20 Thread Ganesh Mahendran
lowmem_count() should only count anon pages when we have swap device. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- drivers/staging/android/lowmemorykiller.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/a

[PATCH v3] mm/compaction: remove unnecessary order check in direct compact path

2016-06-15 Thread Ganesh Mahendran
ned-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- v2: remove the check in __alloc_pages_direct_compact - Anshuman Khandual v3: remove check in __alloc_pages_direct_compact and move current->flags modifying to try_to_compact_pages --- mm/compaction.c | 7 ++- mm/page

[PATCH] Revert "arm64: Increase the max granular size"

2016-03-16 Thread Ganesh Mahendran
Some module like slab/net will use the L1_CACHE_SHIFT, so if we do not set the parameter correctly, it may affect the system performance. So revert the commit. Cc: sta...@vger.kernel.org Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- arch/arm64/in

Re: [PATCH] Revert "arm64: Increase the max granular size"

2016-03-20 Thread Ganesh Mahendran
Hello, Tirumalesh: 2016-03-19 5:05 GMT+08:00 Chalamarla, Tirumalesh <tirumalesh.chalama...@caviumnetworks.com>: > > > > > > On 3/16/16, 2:32 AM, "linux-arm-kernel on behalf of Ganesh Mahendran" > <linux-arm-kernel-boun...@lists.infradead.org on behalf

Re: [PATCHv2] mm/zsmalloc: don't fail if can't create debugfs info

2016-05-19 Thread Ganesh Mahendran
ince v1: > -add pr_warn to all stat failure cases > -do not prevent module loading on stat failure > Reviewed-by: Ganesh Mahendran <opensource.gan...@gmail.com> > mm/zsmalloc.c | 51 ++- > 1 file changed, 22 insertions(+),

Re: [PATCH] mm/zsmalloc: don't fail if can't create debugfs info

2016-05-02 Thread Ganesh Mahendran
Hello, Dan: 2016-04-28 23:36 GMT+08:00 Dan Streetman : > Change the return type of zs_pool_stat_create() to void, and > remove the logic to abort pool creation if the stat debugfs > dir/file could not be created. > > The debugfs stat file is for debugging/information only, and

[PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage()

2016-05-04 Thread Ganesh Mahendran
if we find a zspage with usage == 100%, there is no need to try other zspages. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Cc: Minchan Kim <minc...@kernel.org> Cc: Nitin Gupta <ngu...@vflare.org> Cc: Sergey Senozhatsky <sergey.senozhatsky.w...@gmail.co

Re: [PATCH] mm/zsmalloc: avoid unnecessary iteration in get_pages_per_zspage()

2016-05-05 Thread Ganesh Mahendran
Hi, Minchan: 2016-05-06 11:09 GMT+08:00 Minchan Kim <minc...@kernel.org>: > On Thu, May 05, 2016 at 07:03:29PM +0900, Sergey Senozhatsky wrote: >> On (05/05/16 13:17), Ganesh Mahendran wrote: >> > if we find a zspage with usage == 100%, there is no need to >> &g

Re: [PATCH] mm/vmscan: remove pglist_data->inactive_ratio

2016-07-21 Thread Ganesh Mahendran
Hi, Michal 2016-07-19 15:34 GMT+08:00 Michal Hocko <mho...@kernel.org>: > On Tue 19-07-16 10:07:29, Ganesh Mahendran wrote: >> In patch [1], the inactive_ratio is now automatically calculated > > It is better to give the direct reference to the patch 59dc76b0d4df > (

[PATCH] mm/vmscan: remove pglist_data->inactive_ratio

2016-07-18 Thread Ganesh Mahendran
In patch [1], the inactive_ratio is now automatically calculated in inactive_list_is_low(). So there is no need to keep inactive_ratio in pglist_data, and shown in zoneinfo. [1] mm: vmscan: reduce size of inactive file list Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.

[PATCH v4 4/8] mm/zsmalloc: avoid calculate max objects of zspage twice

2016-07-07 Thread Ganesh Mahendran
(), as there is no other place to call this function. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minchan Kim <minc...@kernel.org> v4: none v3: none v2: remove get_maxobj_per_zspage()

[PATCH v4 7/8] mm/zsmalloc: use helper to clear page->flags bit

2016-07-07 Thread Ganesh Mahendran
user ClearPagePrivate/ClearPagePrivate2 helper to clear PG_private/PG_private_2 in page->flags Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Acked-by: Minchan Kim <minc...@kernel.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> v4: n

[PATCH v4 6/8] mm/zsmalloc: add __init,__exit attribute

2016-07-07 Thread Ganesh Mahendran
Add __init,__exit attribute for function that only called in module init/exit to save memory. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> v4: remove __init/__exit from zsmalloc_mount/zsmalloc_umount v3: revert change in v2 - Sergey v2: add __init/

[PATCH v4 1/8] mm/zsmalloc: use obj_index to keep consistent with others

2016-07-07 Thread Ganesh Mahendran
This is a cleanup patch. Change "index" to "obj_index" to keep consistent with others in zsmalloc. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minchan Kim <minc...@ke

[PATCH v4 2/8] mm/zsmalloc: take obj index back from find_alloced_obj

2016-07-07 Thread Ganesh Mahendran
the obj index value should be updated after return from find_alloced_obj() to avoid CPU burning caused by unnecessary object scanning. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minch

[PATCH v4 5/8] mm/zsmalloc: keep comments consistent with code

2016-07-07 Thread Ganesh Mahendran
some minor change of comments: 1). update zs_malloc(),zs_create_pool() function header 2). update "Usage of struct page fields" Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minchan K

[PATCH v4 8/8] mm/zsmalloc: add per-class compact trace event

2016-07-07 Thread Ganesh Mahendran
naming consistent with others in zsmalloc. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> v4: show number of migrated object rather than the number of scanning object v3: add per-class compact trace event - Minchan I put this patch from 1/8 to 8/8, since this

[PATCH v4 3/8] mm/zsmalloc: use class->objs_per_zspage to get num of max objects

2016-07-07 Thread Ganesh Mahendran
num of max objects in zspage is stored in each size_class now. So there is no need to re-calculate it. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Acked-by: Minchan Kim <minc...@kernel.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> ---

Re: [PATCH v3 8/8] mm/zsmalloc: add per-class compact trace event

2016-07-07 Thread Ganesh Mahendran
2016-07-07 15:44 GMT+08:00 Minchan Kim <minc...@kernel.org>: > Hello Ganesh, > > On Wed, Jul 06, 2016 at 02:23:53PM +0800, Ganesh Mahendran wrote: >> add per-class compact trace event to get scanned objects and freed pages >> number. >> trace log is like below

[PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute

2016-07-06 Thread Ganesh Mahendran
Add __init,__exit attribute for function that only called in module init/exit to save memory. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> v3: revert change in v2 - Sergey v2: add __init/__exit for zs_register_cpu_notifier/zs_unregister_cpu_notifier -

[PATCH v3 8/8] mm/zsmalloc: add per-class compact trace event

2016-07-06 Thread Ganesh Mahendran
kswapd0-629 [001] 293.161455: zs_compact_end: pool zram0: 301 pages compacted Also this patch changes trace_zsmalloc_compact_start[end] to trace_zs_compact_start[end] to keep function naming consistent with others in zsmalloc. Signed-off-by: Ganesh Mahendran

[PATCH v3 7/8] mm/zsmalloc: use helper to clear page->flags bit

2016-07-06 Thread Ganesh Mahendran
user ClearPagePrivate/ClearPagePrivate2 helper to clear PG_private/PG_private_2 in page->flags Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Acked-by: Minchan Kim <minc...@kernel.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> v3:

[PATCH v3 4/8] mm/zsmalloc: avoid calculate max objects of zspage twice

2016-07-06 Thread Ganesh Mahendran
(), as there is no other place to call this function. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minchan Kim <minc...@kernel.org> v3: none v2: remove get_maxobj_per_zspage()

[PATCH v3 5/8] mm/zsmalloc: keep comments consistent with code

2016-07-06 Thread Ganesh Mahendran
some minor change of comments: 1). update zs_malloc(),zs_create_pool() function header 2). update "Usage of struct page fields" Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minchan K

Re: [PATCH v3 6/8] mm/zsmalloc: add __init,__exit attribute

2016-07-06 Thread Ganesh Mahendran
On Wed, Jul 06, 2016 at 02:23:51PM +0800, Ganesh Mahendran wrote: > Add __init,__exit attribute for function that only called in > module init/exit to save memory. > > Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> > > v3: > revert change in

[PATCH v3 1/8] mm/zsmalloc: use obj_index to keep consistent with others

2016-07-06 Thread Ganesh Mahendran
This is a cleanup patch. Change "index" to "obj_index" to keep consistent with others in zsmalloc. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minchan Kim <minc...@kernel.

Re: [PATCH v2 7/8] mm/zsmalloc: add __init,__exit attribute

2016-07-06 Thread Ganesh Mahendran
2016-07-06 10:48 GMT+08:00 Minchan Kim <minc...@kernel.org>: > On Tue, Jul 05, 2016 at 10:00:28AM +0900, Sergey Senozhatsky wrote: >> Hello Ganesh, >> >> On (07/04/16 17:21), Ganesh Mahendran wrote: >> > > On (07/04/16 14:49), Ganesh Mahendran

[PATCH v3 2/8] mm/zsmalloc: take obj index back from find_alloced_obj

2016-07-06 Thread Ganesh Mahendran
the obj index value should be updated after return from find_alloced_obj() to avoid CPU burning caused by unnecessary object scanning. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> Acked-by: Minch

Re: [PATCH v2 1/8] mm/zsmalloc: modify zs compact trace interface

2016-07-06 Thread Ganesh Mahendran
2016-07-06 10:32 GMT+08:00 Minchan Kim <minc...@kernel.org>: > Hi Ganesh, > > On Mon, Jul 04, 2016 at 02:49:52PM +0800, Ganesh Mahendran wrote: >> This patch changes trace_zsmalloc_compact_start[end] to >> trace_zs_compact_start[end] to keep function naming consistent

[PATCH v3 3/8] mm/zsmalloc: use class->objs_per_zspage to get num of max objects

2016-07-06 Thread Ganesh Mahendran
num of max objects in zspage is stored in each size_class now. So there is no need to re-calculate it. Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> Acked-by: Minchan Kim <minc...@kernel.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com> ---

Re: [PATCH 2/3] staging: lowmemorykiller: count anon pages only when we have swap devices

2016-06-30 Thread Ganesh Mahendran
2016-06-23 16:42 GMT+08:00 Sergey Senozhatsky <sergey.senozhatsky.w...@gmail.com>: > On (06/22/16 11:27), Ganesh Mahendran wrote: > [..] >> > > Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> >> > > --- >> > > drivers/staging

[PATCH 8/8] mm/zsmalloc: use helper to clear page->flags bit

2016-07-01 Thread Ganesh Mahendran
user ClearPagePrivate/ClearPagePrivate2 helper to clear PG_private/PG_private_2 in page->flags Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- mm/zsmalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c inde

[PATCH 6/8] mm/zsmalloc: keep comments consistent with code

2016-07-01 Thread Ganesh Mahendran
some minor change of comments: 1). update zs_malloc(),zs_create_pool() function header 2). update "Usage of struct page fields" Signed-off-by: Ganesh Mahendran <opensource.gan...@gmail.com> --- mm/zsmalloc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git

  1   2   3   4   >