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 : > 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 > ("mm: vmscan: reduce siz

[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 --- drivers/staging/android/lowmemorykiller.c | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/staging/android/lowmemorykiller.c

[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 --- drivers/staging/android/lowmemorykiller.c |

[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 --- drivers/staging/android/lowmemorykiller.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging

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 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 return

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] android: binder: use VM_ALLOC to get vm area.

2016-08-31 Thread Ganesh Mahendran
EMAP) align = 1ul << clamp_t(int, fls_long(size), PAGE_SHIFT, IOREMAP_MAX_ORDER); ... } This patch use VM_ALLOC to get vm area. Signed-off-by: Ganesh Mahendran --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/

Re: [PATCH v3] android: binder: use VM_ALLOC to get vm area

2018-01-23 Thread Ganesh Mahendran
Hi, Arve: 2018-01-23 2:55 GMT+08:00 Arve Hjønnevåg : > On Mon, Jan 22, 2018 at 9:02 AM, Todd Kjos wrote: >> On Mon, Jan 22, 2018 at 7:54 AM, Greg KH wrote: >>> On Wed, Jan 10, 2018 at 10:49:05AM +0800, Ganesh Mahendran wrote: >>>> VM_IOREMAP is used to access hardw

Re: [PATCH v3] android: binder: use VM_ALLOC to get vm area

2018-01-24 Thread Ganesh Mahendran
Hi, Todd: 2018-01-23 1:02 GMT+08:00 Todd Kjos : > On Mon, Jan 22, 2018 at 7:54 AM, Greg KH wrote: >> On Wed, Jan 10, 2018 at 10:49:05AM +0800, Ganesh Mahendran wrote: >>> VM_IOREMAP is used to access hardware through a mechanism called >>> I/O mapped memory. Androi

Re: [PATCH v3] android: binder: use VM_ALLOC to get vm area

2018-01-24 Thread Ganesh Mahendran
Hi, Martijn 2018-01-24 22:33 GMT+08:00 Martijn Coenen : > On Mon, Jan 22, 2018 at 4:54 PM, Greg KH wrote: >> Martijn and Todd, any objections to this patch? > > Looks good to me. Thanks for your review. Should I cherry-pick this change to aosp kernel 3.10/3.18/4.4/4.9 now? Thanks. > >> >> tha

[PATCH v3] android: binder: use VM_ALLOC to get vm area

2018-01-09 Thread Ganesh Mahendran
gt;[ 4482.440053] binder_alloc: binder_alloc_mmap_handler: 15728 8ce67000-8cf65000 get_vm_area failed -12 <3>[ 4483.218817] binder_alloc: binder_alloc_mmap_handler: 15745 8ce67000-8cf65000 get_vm_area failed -12 Signed-off-by: Ganesh Mahendran V3: update comments V2: update comment

Re: [PATCH v2] PM / wakeup: use seq_open() to show wakeup stats

2018-03-11 Thread Ganesh Mahendran
Hello, Rafael: 2018-03-05 16:47 GMT+08:00 Ganesh Mahendran : > single_open() interface requires that the whole output must > fit into a single buffer. This will lead to timeout when > system memory is not in a good situation. > > This patch use seq_open() to show wakeup stats. Thi

Re: [PATCH v9 00/24] Speculative page faults

2018-03-21 Thread Ganesh Mahendran
Hi, Laurent 2018-03-14 1:59 GMT+08:00 Laurent Dufour : > This is a port on kernel 4.16 of the work done by Peter Zijlstra to > handle page fault without holding the mm semaphore [1]. > > The idea is to try to handle user space page faults without holding the > mmap_sem. This should allow better co

Re: [PATCH v5] ANDROID: binder: change down_write to down_read

2018-04-08 Thread Ganesh Mahendran
>> On Mon, Apr 02, 2018 at 06:01:59PM +0800, Ganesh Mahendran wrote: >>> 2018-04-02 15:11 GMT+08:00 Minchan Kim : >>> > On Mon, Apr 02, 2018 at 02:46:14PM +0800, Ganesh Mahendran wrote: >>> >> 2018-04-02 14:34 GMT+08:00 Minchan Kim : >>> >> &g

Re: [PATCH v5] ANDROID: binder: change down_write to down_read

2018-04-10 Thread Ganesh Mahendran
2018-04-02 18:32 GMT+08:00 Minchan Kim : > Hi Ganesh, > > On Mon, Apr 02, 2018 at 06:01:59PM +0800, Ganesh Mahendran wrote: >> 2018-04-02 15:11 GMT+08:00 Minchan Kim : >> > On Mon, Apr 02, 2018 at 02:46:14PM +0800, Ganesh Mahendran wrote: >> >> 2018-04-02 14:3

Re: [PATCH v2] PM / wakeup: use seq_open() to show wakeup stats

2018-03-13 Thread Ganesh Mahendran
Hi, Andy 2018-03-14 0:39 GMT+08:00 Andy Shevchenko : > On Mon, Mar 5, 2018 at 10:47 AM, Ganesh Mahendran > wrote: >> single_open() interface requires that the whole output must >> fit into a single buffer. This will lead to timeout when >> system memory is not in a go

[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 --- mm/zsmalloc.c | 108 ++--- 1 file changed, 104 insertions(+), 4 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c

[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 --- fs/debugfs/file.c | 45 + include/linux

[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 --- drivers/block/zram/zram_drv.c |8 +--- include/linux

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

2014-12-26 Thread Ganesh Mahendran
Signed-off-by: Ganesh Mahendran Suggested-by: Minchan Kim Cc: Nitin Gupta --- mm/Kconfig| 10 +++ mm/zsmalloc.c | 244 - 2 files changed, 250 insertions(+), 4 deletions(-) diff --git a/mm/Kconfig b/mm/Kconfig index 1d1ae6b..95c5728 10

[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 Cc: Seth Jennings Cc: Nitin Gupta Cc: Dan Streetman Acked-by

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

2014-12-29 Thread Ganesh Mahendran
Signed-off-by: Ganesh Mahendran Suggested-by: Minchan Kim Cc: Nitin Gupta Acked-by: Minchan Kim --- Change in V2: use array in struct zs_size_stat -- Minchan --- mm/Kconfig| 10 +++ mm/zsmalloc.c | 233 - 2 files changed, 239

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 : > 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 a new c

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

2014-12-29 Thread Ganesh Mahendran
Signed-off-by: Ganesh Mahendran Suggested-by: Minchan Kim Cc: Nitin Gupta Acked-by: Minchan Kim --- Change in V2: use array in struct zs_size_stat -- Minchan add name argument in zs_pool_stat_create when CONFIG_ZSMALLOC_STAT not defined -- Minchan --- mm/Kconfig| 10 +++ mm/zsmallo

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 : > 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 >> --- >> >> I don't think it's stable materia

[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 Cc: Nitin Gupta Cc: Minchan Kim --- drivers/block/zram/zram_drv.c | 28 ++-- drivers

[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 Cc: Nitin Gupta Cc: Minchan Kim --- mm/zsmalloc.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index

[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 Cc: Nitin Gupta Cc: Minchan Kim ---

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 : > 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 and returns it t

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 : > 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 &g

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 : > On Sat, 24 Jan 2015 21:48:41 +0800 Ganesh Mahendran > wrote: > >> Sometimes, we want to know whether a module is loaded or unloaded >> from the log. > > Why? What's special about zsmalloc? > > Pl

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

2015-01-28 Thread Ganesh Mahendran
located. So it it better to free >> > it in zram_meta_free(). >> > >> > Signed-off-by: Ganesh Mahendran >> > Signed-off-by: Minchan Kim >> > --- >> > drivers/block/zram/zram_drv.c | 30 ++ >> >

Re: [PATCH v8 22/24] mm: Speculative page fault handler return VMA

2018-03-28 Thread Ganesh Mahendran
Hi, Laurent 2018-02-16 23:25 GMT+08:00 Laurent Dufour : > When the speculative page fault handler is returning VM_RETRY, there is a > chance that VMA fetched without grabbing the mmap_sem can be reused by the > legacy page fault handler. By reusing it, we avoid calling find_vma() > again. To achi

Re: [PATCH v8 22/24] mm: Speculative page fault handler return VMA

2018-03-28 Thread Ganesh Mahendran
2018-03-29 10:26 GMT+08:00 Ganesh Mahendran : > Hi, Laurent > > 2018-02-16 23:25 GMT+08:00 Laurent Dufour : >> When the speculative page fault handler is returning VM_RETRY, there is a >> chance that VMA fetched without grabbing the mmap_sem can be reused by the >> leg

Re: [PATCH v2] PM / wakeup: use seq_open() to show wakeup stats

2018-03-29 Thread Ganesh Mahendran
ping. 2018-03-05 16:47 GMT+08:00 Ganesh Mahendran : > single_open() interface requires that the whole output must > fit into a single buffer. This will lead to timeout when > system memory is not in a good situation. > > This patch use seq_open() to show wakeup stats. This method

Re: [PATCH v3] PM / wakeup: use seq_open() to show wakeup stats

2018-05-01 Thread Ganesh Mahendran
Hi, Pavel Thanks for your review. 2018-04-29 22:30 GMT+08:00 Pavel Machek : > On Wed 2018-04-25 18:59:31, Ganesh Mahendran wrote: >> single_open() interface requires that the whole output must >> fit into a single buffer. This will lead to timeout when >> system memory is no

[PATCH 1/2] arm64/mm: define ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT

2018-05-02 Thread Ganesh Mahendran
Set ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT for arm64. This enables Speculative Page Fault handler. Signed-off-by: Ganesh Mahendran --- This patch is on top of Laurent's v10 spf --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig

[PATCH 1/2] arm64/mm: define ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT

2018-05-02 Thread Ganesh Mahendran
Set ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT for arm64. This enables Speculative Page Fault handler. Signed-off-by: Ganesh Mahendran --- This patch is on top of Laurent's v10 spf --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig

[PATCH 2/2] arm64/mm: add speculative page fault

2018-05-02 Thread Ganesh Mahendran
: Ganesh Mahendran --- This patch is on top of Laurent's v10 spf --- arch/arm64/mm/fault.c | 38 +++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 4165485..e7992a3 100644 --- a/arch/arm64/mm/fa

Re: [PATCH v8 22/24] mm: Speculative page fault handler return VMA

2018-05-02 Thread Ganesh Mahendran
2018-03-29 15:50 GMT+08:00 Laurent Dufour : > On 29/03/2018 05:06, Ganesh Mahendran wrote: >> 2018-03-29 10:26 GMT+08:00 Ganesh Mahendran : >>> Hi, Laurent >>> >>> 2018-02-16 23:25 GMT+08:00 Laurent Dufour : >>>> When the speculative page fault handl

Re: [PATCH v10 23/25] mm: add speculative page fault vmstats

2018-05-15 Thread Ganesh Mahendran
2018-04-17 22:33 GMT+08:00 Laurent Dufour : > Add speculative_pgfault vmstat counter to count successful speculative page > fault handling. > > Also fixing a minor typo in include/linux/vm_event_item.h. > > Signed-off-by: Laurent Dufour > --- > include/linux/vm_event_item.h | 3 +++ > mm/memory.c

[PATCH v3] PM / wakeup: use seq_open() to show wakeup stats

2018-04-25 Thread Ganesh Mahendran
single_open() interface requires that the whole output must fit into a single buffer. This will lead to timeout when system memory is not in a good situation. This patch use seq_open() to show wakeup stats. This method need only one page, so timeout will not be observed. Signed-off-by: Ganesh

Re: [PATCH v2] PM / wakeup: use seq_open() to show wakeup stats

2018-04-25 Thread Ganesh Mahendran
2018-04-02 14:46 GMT+08:00 Geert Uytterhoeven : > Hi Ganesh, > > On Mon, Apr 2, 2018 at 3:33 AM, Ganesh Mahendran > wrote: >> 2018-03-30 19:00 GMT+08:00 Geert Uytterhoeven : >>> On Fri, Mar 30, 2018 at 12:25 PM, Rafael J. Wysocki >>> wrote: >>>>

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 : > 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 >> > try other zspages. &g

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 doesn't > affect ope

[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 Cc: Minchan Kim Cc: Nitin Gupta Cc: Sergey Senozhatsky --- mm/zsmalloc.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index fda7177

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

2016-05-19 Thread Ganesh Mahendran
STAT was enabled. > > Signed-off-by: Dan Streetman > Cc: Sergey Senozhatsky > Cc: Dan Streetman > Cc: Minchan Kim > > --- > Changes since v1: > -add pr_warn to all stat failure cases > -do not prevent module loading on

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 : > On Thu, Nov 20, 2014 at 8:08 AM, 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 unnecessary assign

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 : > 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 unnecessary as

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 : > 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 = ZS_MIN_AL

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 : > 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 the highest bi

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 : > On Thu, Nov 13, 2014 at 8:02 AM, Minchan Kim 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 bit (ZRAM_FLAG_SHIFT - 1) repres

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 : > 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, we never got to the

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 : > 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 Thanks very much! > >> >> Sig

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 : > 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 in current code, it wi

[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 --- mm/zsmalloc.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

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 : > 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 : >> &g

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

2014-11-25 Thread Ganesh Mahendran
first class has been allocated. Signed-off-by: Ganesh Mahendran Cc: Minchan Kim Cc: Nitin Gupta Cc: Dan Streetman --- v1 -> v2: - follow Dan Streetman's advise to use prev_class to check whether the first class has been allocated - follow Minchan Kim's adv

[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 --- drivers/block/zram/zram_drv.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c

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 : > 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 modifies the address

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 : > 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 : >> >

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 : > 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 : >> > Hello Ganesh, >> > >> > On Wed, Dec 17, 2014 at 03:05:19PM +08

[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 Suggested-by: Minchan Kim Cc: Nitin Gupta --- V1 -> V2: create and use zs_size_stat to store the zs stat - Mi

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 : > On Fri, 19 Dec 2014 20:55:19 +0800 Ganesh Mahendran > wrote: > >> Keeping fragmentation of zsmalloc in a low level is our target. But now >> we still need to add the debug code in zsmalloc to

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

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

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 : > 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 : >> > On Fri, Dec 19, 2014 at 04:17:56PM -0800, Andrew Morton wrote: >> >>

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 : > 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 : >> > The pool->size_class[i] is assigned with the

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 : > 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

[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 Cc: Nitin Gupta Cc: Minchan Kim Cc: Sergey Senozhatsky --- v2: use zram->disksize to get num of pages - Ser

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 : > 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 or swaped on.

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 : > 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

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

2015-01-31 Thread Ganesh Mahendran
it of /dev/zram0. Signed-off-by: Ganesh Mahendran Cc: Nitin Gupta Cc: Minchan Kim Cc: Sergey Senozhatsky --- drivers/block/zram/zram_drv.c | 79 ++--- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/

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 : > 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: >>

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 : > 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_siz

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 : > On (01/31/15 16:50), Ganesh Mahendran wrote: >> >> > after umount we still have init device. so, *theoretically*, we >> >> > can see something like >> >> > >> >> &

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 : > 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

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 : > 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

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 : > 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.

Re: [RFC 0/6] zsmalloc support compaction

2014-12-17 Thread Ganesh Mahendran
2014-12-18 7:19 GMT+08:00 Seth Jennings : > 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 investigation reve

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 : > 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 >> debugf

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 : > 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 fr

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

2014-12-11 Thread Ganesh Mahendran
2014-12-12 14:40 GMT+08:00 Minchan Kim : > 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 : >> > Hello Ganesh, >> > >> > On Wed, Dec 10, 2014 at 09:40:20PM +0800, Ganes

[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 --- mm

[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 Suggested

[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 --- arch/arm64/include/asm/cache.h |2 +- 1 file chan

Re: [PATCH v5] ANDROID: binder: change down_write to down_read

2018-03-29 Thread Ganesh Mahendran
2018-03-29 14:54 GMT+08:00 Minchan Kim : > binder_update_page_range needs down_write of mmap_sem because > vm_insert_page need to change vma->vm_flags to VM_MIXEDMAP unless > it is set. However, when I profile binder working, it seems > every binder buffers should be mapped in advance by binder_mma

Re: [PATCH v5] ANDROID: binder: change down_write to down_read

2018-03-29 Thread Ganesh Mahendran
2018-03-30 9:29 GMT+08:00 Minchan Kim : > Hi Ganesh, > > On Fri, Mar 30, 2018 at 09:21:55AM +0800, Ganesh Mahendran wrote: >> 2018-03-29 14:54 GMT+08:00 Minchan Kim : >> > binder_update_page_range needs down_write of mmap_sem because >> > vm_insert_page need to ch

Re: [PATCH v2] PM / wakeup: use seq_open() to show wakeup stats

2018-04-01 Thread Ganesh Mahendran
2018-03-30 18:25 GMT+08:00 Rafael J. Wysocki : > On Monday, March 5, 2018 9:47:46 AM CEST Ganesh Mahendran wrote: >> single_open() interface requires that the whole output must >> fit into a single buffer. This will lead to timeout when >> system memory is not in a good situat

Re: [PATCH v2] PM / wakeup: use seq_open() to show wakeup stats

2018-04-01 Thread Ganesh Mahendran
2018-03-30 19:00 GMT+08:00 Geert Uytterhoeven : > On Fri, Mar 30, 2018 at 12:25 PM, Rafael J. Wysocki > wrote: >> On Monday, March 5, 2018 9:47:46 AM CEST Ganesh Mahendran wrote: >>> single_open() interface requires that the whole output must >>> fit into a si

Re: [PATCH v5] ANDROID: binder: change down_write to down_read

2018-04-01 Thread Ganesh Mahendran
2018-04-02 14:34 GMT+08:00 Minchan Kim : > On Fri, Mar 30, 2018 at 12:04:07PM +0200, Greg Kroah-Hartman wrote: >> On Fri, Mar 30, 2018 at 10:29:21AM +0900, Minchan Kim wrote: >> > Hi Ganesh, >> > >> > On Fri, Mar 30, 2018 at 09:21:55AM +0800, Ganesh Mahendran w

Re: [PATCH v5] ANDROID: binder: change down_write to down_read

2018-04-02 Thread Ganesh Mahendran
2018-04-02 15:11 GMT+08:00 Minchan Kim : > On Mon, Apr 02, 2018 at 02:46:14PM +0800, Ganesh Mahendran wrote: >> 2018-04-02 14:34 GMT+08:00 Minchan Kim : >> > On Fri, Mar 30, 2018 at 12:04:07PM +0200, Greg Kroah-Hartman wrote: >> >> On Fri, Mar 30, 2018 at 10:29

Re: [PATCH] scsi_lib: increase {host|target|device}_busy count after dispatch cmd

2018-03-01 Thread Ganesh Mahendran
Hi, Bart: 2018-03-02 7:11 GMT+08:00 Bart Van Assche : > On Mon, 2017-06-05 at 17:37 +0800, Ganesh Mahendran wrote: >> In android system, when there are lots of threads running. Thread A >> holding *host_busy* count is easily to be preempted, and if at the >> same time, threa

[PATCH] PM / wakeup: use seq_open() to show wakeup stats

2018-03-01 Thread Ganesh Mahendran
single_open() interface requires that the whole output must fit into a single buffer. This will lead to timeout when system memory is not in a good situation. This patch use seq_open() to show wakeup stats. This method need only one page, so timeout will not be observed. Signed-off-by: Ganesh

Re: [PATCH] PM / wakeup: use seq_open() to show wakeup stats

2018-03-02 Thread Ganesh Mahendran
Hi, Rafael: 2018-03-02 16:58 GMT+08:00 Rafael J. Wysocki : > On Fri, Mar 2, 2018 at 6:01 AM, Ganesh Mahendran > wrote: >> single_open() interface requires that the whole output must >> fit into a single buffer. This will lead to timeout when >> system memory is not in a

[PATCH v2] PM / wakeup: use seq_open() to show wakeup stats

2018-03-05 Thread Ganesh Mahendran
single_open() interface requires that the whole output must fit into a single buffer. This will lead to timeout when system memory is not in a good situation. This patch use seq_open() to show wakeup stats. This method need only one page, so timeout will not be observed. Signed-off-by: Ganesh

Re: [PATCH 1/2] arm64/mm: define ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT

2018-05-03 Thread Ganesh Mahendran
2018-05-02 20:23 GMT+08:00 Will Deacon : > On Wed, May 02, 2018 at 03:53:21PM +0800, Ganesh Mahendran wrote: >> Set ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT for arm64. This >> enables Speculative Page Fault handler. > > Are there are tests for this? I'm really nervous about e

Re: [PATCH 2/2] arm64/mm: add speculative page fault

2018-05-03 Thread Ganesh Mahendran
2018-05-02 17:07 GMT+08:00 Laurent Dufour : > On 02/05/2018 09:54, Ganesh Mahendran wrote: >> This patch enables the speculative page fault on the arm64 >> architecture. >> >> I completed spf porting in 4.9. From the test result, >> we can see app launching time

Re: [PATCH 2/2] arm64/mm: add speculative page fault

2018-05-03 Thread Ganesh Mahendran
2018-05-02 22:46 GMT+08:00 Punit Agrawal : > Hi Ganesh, > > I was looking at evaluating speculative page fault handling on arm64 and > noticed your patch. > > Some comments below - Thanks for your review. > > Ganesh Mahendran writes: > >> This patch enables

[PATCH v2 2/2] arm64/mm: add speculative page fault

2018-05-03 Thread Ganesh Mahendran
: Ganesh Mahendran --- v2: move find_vma() to do_page_fault() remove IS_ENABLED() remove fault != VM_FAULT_SIGSEGV check initilize vma = NULL --- arch/arm64/mm/fault.c | 29 + 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch

  1   2   >