Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 06:12:11PM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > > I don't think this is something the radix tree should know about. > >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 06:12:11PM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 08:04:09AM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > > > I don't think this is something the radix tree should know about. > >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 11:49:58PM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > > > On 2018/4/9 19:25, Minchan Kim wrote: > > > > On Mon, Apr 09, 2018 at 04

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:20:32AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 11:49:58PM +0900, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > > > On 2018/4/9 19:25, Minchan Kim wrote: > > > > On Mon, Apr 09, 2018 at 04

Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Minchan Kim
On Mon, 9 Apr 2018 10:03:45 +0200 Greg KH <gre...@linuxfoundation.org> wrote: > On Mon, Apr 09, 2018 at 02:54:35PM +0900, Minchan Kim wrote: > > zRam as swap is useful for small memory device. However, swap means > > those pages on zram are mostly cold pages due

Re: [PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-09 Thread Minchan Kim
On Mon, 9 Apr 2018 10:03:45 +0200 Greg KH wrote: > On Mon, Apr 09, 2018 at 02:54:35PM +0900, Minchan Kim wrote: > > zRam as swap is useful for small memory device. However, swap means > > those pages on zram are mostly cold pages due to VM's LRU algorithm. > > Espec

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > On 2018/4/9 19:25, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > >>> On Sun, Apr 08, 2018 at 07

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 08:25:06PM +0800, Chao Yu wrote: > On 2018/4/9 19:25, Minchan Kim wrote: > > On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > >> On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > >>> On Sun, Apr 08, 2018 at 07

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > >

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 04:14:03AM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 12:09:30PM +0900, Minchan Kim wrote: > > On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > > > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > >

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

2018-04-09 Thread Minchan Kim
Hi Ganesh, Isn't there any update? On Mon, Apr 2, 2018 at 7:32 PM, Minchan Kim <minc...@kernel.org> wrote: > 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 <minc...@kernel.org>: >> >

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

2018-04-09 Thread Minchan Kim
Hi Ganesh, Isn't there any update? On Mon, Apr 2, 2018 at 7:32 PM, Minchan Kim wrote: > 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 Mah

[PATCH v3 1/4] zram: correct flag name of ZRAM_ACCESS

2018-04-08 Thread Minchan Kim
. Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/block/zram/zram_drv.c | 20 ++-- drivers/block/zram/zram_drv.h | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 0f3fad

[PATCH v3 1/4] zram: correct flag name of ZRAM_ACCESS

2018-04-08 Thread Minchan Kim
. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 20 ++-- drivers/block/zram/zram_drv.h | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 0f3fadd71230..18dadeab775b 100644

[PATCH v3 2/4] zram: mark incompressible page as ZRAM_HUGE

2018-04-08 Thread Minchan Kim
exposes new stat for huge pages via mm_stat. Signed-off-by: Minchan Kim <minc...@kernel.org> --- Documentation/blockdev/zram.txt | 1 + drivers/block/zram/zram_drv.c | 17 ++--- drivers/block/zram/zram_drv.h | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff

[PATCH v3 2/4] zram: mark incompressible page as ZRAM_HUGE

2018-04-08 Thread Minchan Kim
exposes new stat for huge pages via mm_stat. Signed-off-by: Minchan Kim --- Documentation/blockdev/zram.txt | 1 + drivers/block/zram/zram_drv.c | 17 ++--- drivers/block/zram/zram_drv.h | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Documentation/blockdev

[PATCH v3 0/4] zram memory tracking

2018-04-08 Thread Minchan Kim
to the backing store. * From v2: * debugfs and Kconfig cleanup - Greg KH * Remove unnecesarry buffer - Sergey * Change timestamp from sec to usec * From v1: * Do not propagate error number for debugfs fail - Greg KH * Add writeback and hugepage information - Sergey Minchan Kim (4): zram

[PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-08 Thread Minchan Kim
g> Signed-off-by: Minchan Kim <minc...@kernel.org> --- Documentation/blockdev/zram.txt | 24 ++ drivers/block/zram/Kconfig | 9 +++ drivers/block/zram/zram_drv.c | 139 +--- drivers/block/zram/zram_drv.h | 5 ++ 4 files changed, 166 insertions(+),

[PATCH v3 3/4] zram: record accessed second

2018-04-08 Thread Minchan Kim
footprint. Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/block/zram/zram_drv.c | 16 drivers/block/zram/zram_drv.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 777fb3339f59..7fc10e

[PATCH v3 0/4] zram memory tracking

2018-04-08 Thread Minchan Kim
to the backing store. * From v2: * debugfs and Kconfig cleanup - Greg KH * Remove unnecesarry buffer - Sergey * Change timestamp from sec to usec * From v1: * Do not propagate error number for debugfs fail - Greg KH * Add writeback and hugepage information - Sergey Minchan Kim (4): zram

[PATCH v3 4/4] zram: introduce zram memory tracking

2018-04-08 Thread Minchan Kim
ve example means the 300th block is accessed at 75.033851 second and it was huge so it was written to the backing store. Admin can leverage this information to catch cold|incompressible pages of process with *pagemap* once part of heaps are swapped out. Cc: Greg KH Signed-off-by: M

[PATCH v3 3/4] zram: record accessed second

2018-04-08 Thread Minchan Kim
footprint. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 16 drivers/block/zram/zram_drv.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 777fb3339f59..7fc10e2ad734 100644 --- a/drivers

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > It assumes shadow entry of radix tree relies on the init state > > that node->private_list allocated should be list_empty state. > > Cur

Re: [PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
On Sun, Apr 08, 2018 at 07:49:25PM -0700, Matthew Wilcox wrote: > On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote: > > It assumes shadow entry of radix tree relies on the init state > > that node->private_list allocated should be list_empty state. > > Cur

[PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
ner <han...@cmpxchg.org> Cc: Jan Kara <j...@suse.cz> Signed-off-by: Minchan Kim <minc...@kernel.org> --- If it is reviewed and proved with testing, I will resend the patch to Ccing sta...@vger.kernel.org. Thanks. lib/radix-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 dele

[PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
e !list_empty(node->private_list). It ends up calling NULL deference at workingset_update_node by failing list_empty check. This patch should fix it. Fixes: 449dd6984d0e ("mm: keep page cache radix tree nodes in check") Reported-by: Chris Fries Cc: Johannes Weiner Cc: Jan Kara

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

2018-04-02 Thread 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 <minc...@kernel.org>: > > On Mon, Apr 02, 2018 at 02:46:14PM +0800, Ganesh Mahendran wrote: > >> 2018-04-02 14:34 GMT+08:00 Minchan Kim <minc...@kernel.

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

2018-04-02 Thread 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:34 GMT+08:00 Minchan Kim : > >> > On Fri, Mar 30, 2018 a

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

2018-04-02 Thread 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 <minc...@kernel.org>: > > 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

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

2018-04-02 Thread 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:21AM +0900, Minchan Kim wrote: > >> > Hi Ganesh

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

2018-04-02 Thread 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 wrote: > > > 2018-03-29 14:54 GMT+08:00 M

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

2018-04-02 Thread 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 wrote: > > > 2018-03-

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

2018-03-29 Thread Minchan Kim
On Fri, Mar 30, 2018 at 09:39:03AM +0800, Ganesh Mahendran wrote: > 2018-03-30 9:29 GMT+08:00 Minchan Kim <minc...@kernel.org>: > > Hi Ganesh, > > > > On Fri, Mar 30, 2018 at 09:21:55AM +0800, Ganesh Mahendran wrote: > >> 2018-03-29 14:54 GMT+0

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

2018-03-29 Thread Minchan Kim
On Fri, Mar 30, 2018 at 09:39:03AM +0800, Ganesh Mahendran wrote: > 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 : > >> >

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

2018-03-29 Thread 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 <minc...@kernel.org>: > > binder_update_page_range needs down_write of mmap_sem because > > vm_insert_page need to change vma->vm_flags to VM_MIXED

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

2018-03-29 Thread 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 change vma->vm_flags to VM_MIXEDMAP unless > > it is set.

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

2018-03-29 Thread Minchan Kim
-rc7 next-20180329] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Minchan-Kim/ANDROID-binder-change-down_write-to-down_read/20180330-043057 > config: x86_64-randcon

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

2018-03-29 Thread Minchan Kim
-rc7 next-20180329] > [if your patch is applied to the wrong git tree, please drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Minchan-Kim/ANDROID-binder-change-down_write-to-down_read/20180330-043057 > config: x86_64-randcon

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

2018-03-29 Thread Minchan Kim
; Cc: Todd Kjos <tk...@google.com> Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Reviewed-by: Martijn Coenen <m...@android.com> Signed-off-by: Minchan Kim <minc...@kernel.org> --- >From v4: * Fix typo and VM flags clear handling - Joe >From v3: * Fix typo >

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

2018-03-29 Thread Minchan Kim
wed-by: Martijn Coenen Signed-off-by: Minchan Kim --- >From v4: * Fix typo and VM flags clear handling - Joe >From v3: * Fix typo >From v2: * Fix vma->flag setting - Arve >From v1: * remove WARN_ON_ONCE - Greg * add reviewed-by - Martijn Martijn, I took your LGTM of v1 as R

[PATCH v4] ANDROID: binder: change down_write to down_read

2018-03-29 Thread Minchan Kim
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Reviewed-by: Martijn Coenen <m...@android.com> Signed-off-by: Minchan Kim <minc...@kernel.org> --- >From v3: * Fix typoe >From v2: * Fix vma->flag setting - Arve >From v1: * remove WARN_ON_ONCE - Greg * add rev

[PATCH v4] ANDROID: binder: change down_write to down_read

2018-03-29 Thread Minchan Kim
nen Signed-off-by: Minchan Kim --- >From v3: * Fix typoe >From v2: * Fix vma->flag setting - Arve >From v1: * remove WARN_ON_ONCE - Greg * add reviewed-by - Martijn Martijn, I took your LGTM of v1 as Reviewed-by. If you don't like it or want to change it to acked-by, please, tel

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

2018-03-28 Thread Minchan Kim
On Thu, Mar 29, 2018 at 11:37:12AM +0900, Minchan Kim wrote: > 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 s

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

2018-03-28 Thread Minchan Kim
On Thu, Mar 29, 2018 at 11:37:12AM +0900, Minchan Kim wrote: > 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 s

[PATCH v3] ANDROID: binder: change down_write to down_read

2018-03-28 Thread Minchan Kim
tion.org> Cc: Arve Hjønnevåg <a...@android.com> Reviewed-by: Martijn Coenen <m...@android.com> Signed-off-by: Minchan Kim <minc...@kernel.org> --- >From v2: * Fix vma->flag setting - Arve >From v1: * remove WARN_ON_ONCE - Greg * add reviewed-by - Martijn M

[PATCH v3] ANDROID: binder: change down_write to down_read

2018-03-28 Thread Minchan Kim
nen Signed-off-by: Minchan Kim --- >From v2: * Fix vma->flag setting - Arve >From v1: * remove WARN_ON_ONCE - Greg * add reviewed-by - Martijn Martijn, I took your LGTM of v1 as Reviewed-by. If you don't like it or want to change it to acked-by, please, tell me. drivers/andr

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

2018-03-28 Thread Minchan Kim
On Wed, Mar 28, 2018 at 06:59:41PM -0700, Arve Hjønnevåg wrote: > On Wed, Mar 28, 2018 at 6:00 PM, Minchan Kim <minc...@kernel.org> wrote: > > binder_update_page_range needs down_write of mmap_sem because > > vm_insert_page need to change vma->vm_flags to VM_MIXEDMAP unles

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

2018-03-28 Thread Minchan Kim
On Wed, Mar 28, 2018 at 06:59:41PM -0700, Arve Hjønnevåg wrote: > On Wed, Mar 28, 2018 at 6:00 PM, Minchan Kim wrote: > > 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.

[PATCH v2] ANDROID: binder: change down_write to down_read

2018-03-28 Thread Minchan Kim
undation.org> Reviewed-by: Martijn Coenen <m...@android.com> Signed-off-by: Minchan Kim <minc...@kernel.org> --- >From v1: * remove WARN_ON_ONCE - Greg * add reviewed-by - Martijn Martijn, I took your LGTM of v1 as Reviewed-by. If you don't like it or want to change it to acked-b

[PATCH v2] ANDROID: binder: change down_write to down_read

2018-03-28 Thread Minchan Kim
MAP in bider_mmap time which is already hold a mmap_sem as down_write so binder_update_page_range doesn't need to hold a mmap_sem as down_write. Android suffers from mmap_sem contention so let's reduce mmap_sem down_write. Cc: Todd Kjos Cc: Greg Kroah-Hartman Reviewed-by: Martijn Coenen Signed-off-by: Minc

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

2018-03-28 Thread Minchan Kim
On Wed, Mar 28, 2018 at 07:53:54AM +0200, Greg Kroah-Hartman wrote: > On Wed, Mar 28, 2018 at 11:42:31AM +0900, Minchan Kim wrote: > > 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

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

2018-03-28 Thread Minchan Kim
On Wed, Mar 28, 2018 at 07:53:54AM +0200, Greg Kroah-Hartman wrote: > On Wed, Mar 28, 2018 at 11:42:31AM +0900, Minchan Kim wrote: > > 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

[PATCH] ANDROID: binder: change down_write to down_read

2018-03-27 Thread Minchan Kim
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org> Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/android/binder.c | 2 +- drivers/android/binder_alloc.c | 8 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/android/binder.c b/dri

[PATCH] ANDROID: binder: change down_write to down_read

2018-03-27 Thread Minchan Kim
MAP in bider_mmap time which is already hold a mmap_sem as down_write so binder_update_page_range doesn't need to hold a mmap_sem as down_write. Android suffers from mmap_sem contention so let's reduce mmap_sem down_write. Cc: Martijn Coenen Cc: Todd Kjos Cc: Greg Kroah-Hartman Signed-off-by: Minchan

Re: [PATCH v2 4/4] zram: introduce zram memory tracking

2018-03-27 Thread Minchan Kim
Hi Greg, On Tue, Mar 27, 2018 at 09:12:38AM +0200, Greg KH wrote: > On Tue, Mar 27, 2018 at 03:50:33PM +0900, Minchan Kim wrote: > > zRam as swap is useful for small memory device. However, swap means > > those pages on zram are mostly cold pages due to VM's LRU algorithm. >

Re: [PATCH v2 4/4] zram: introduce zram memory tracking

2018-03-27 Thread Minchan Kim
Hi Greg, On Tue, Mar 27, 2018 at 09:12:38AM +0200, Greg KH wrote: > On Tue, Mar 27, 2018 at 03:50:33PM +0900, Minchan Kim wrote: > > zRam as swap is useful for small memory device. However, swap means > > those pages on zram are mostly cold pages due to VM's LRU algorithm. >

[PATCH v2 1/4] zram: correct flag name of ZRAM_ACCESS

2018-03-27 Thread Minchan Kim
. Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/block/zram/zram_drv.c | 20 ++-- drivers/block/zram/zram_drv.h | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 0f3fad

[PATCH v2 1/4] zram: correct flag name of ZRAM_ACCESS

2018-03-27 Thread Minchan Kim
. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 20 ++-- drivers/block/zram/zram_drv.h | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 0f3fadd71230..18dadeab775b 100644

[PATCH v2 3/4] zram: record accessed second

2018-03-27 Thread Minchan Kim
footprint. Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/block/zram/zram_drv.c | 16 drivers/block/zram/zram_drv.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 777fb3339f59..aa48d3

[PATCH v2 3/4] zram: record accessed second

2018-03-27 Thread Minchan Kim
footprint. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 16 drivers/block/zram/zram_drv.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 777fb3339f59..aa48d3e0d4fc 100644 --- a/drivers

[PATCH v2 4/4] zram: introduce zram memory tracking

2018-03-27 Thread Minchan Kim
g> Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/block/zram/Kconfig| 10 +++ drivers/block/zram/zram_drv.c | 124 +++--- drivers/block/zram/zram_drv.h | 3 + 3 files changed, 126 insertions(+), 11 deletions(-) diff --git a/drivers/block/zram/K

[PATCH v2 4/4] zram: introduce zram memory tracking

2018-03-27 Thread Minchan Kim
. So above example means the 25065th block is accessed 100 second ago and it was huge so it was written to the backing store. Admin can leverage this information to catch cold|incompressible pages of process with *pagemap* once part of heaps are swapped out. Cc: Greg KH Signed-off-by: Minchan Kim --

[PATCH v2 2/4] zram: mark incompressible page as ZRAM_HUGE

2018-03-27 Thread Minchan Kim
exposes new stat for huge pages via mm_stat. Signed-off-by: Minchan Kim <minc...@kernel.org> --- Documentation/blockdev/zram.txt | 1 + drivers/block/zram/zram_drv.c | 17 ++--- drivers/block/zram/zram_drv.h | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff

[PATCH v2 0/4] zram memory tracking

2018-03-27 Thread Minchan Kim
to the backing store. * From v1: * Do not propagate error number for debugfs fail - Greg KH * Add writeback and hugepage information - Sergey Minchan Kim (4): zram: correct flag name of ZRAM_ACCESS zram: mark incompressible page as ZRAM_HUGE zram: record accessed second zram: introduce zram

[PATCH v2 0/4] zram memory tracking

2018-03-27 Thread Minchan Kim
to the backing store. * From v1: * Do not propagate error number for debugfs fail - Greg KH * Add writeback and hugepage information - Sergey Minchan Kim (4): zram: correct flag name of ZRAM_ACCESS zram: mark incompressible page as ZRAM_HUGE zram: record accessed second zram: introduce zram

[PATCH v2 2/4] zram: mark incompressible page as ZRAM_HUGE

2018-03-27 Thread Minchan Kim
exposes new stat for huge pages via mm_stat. Signed-off-by: Minchan Kim --- Documentation/blockdev/zram.txt | 1 + drivers/block/zram/zram_drv.c | 17 ++--- drivers/block/zram/zram_drv.h | 2 ++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Documentation/blockdev

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Tue, Mar 27, 2018 at 11:21:26AM +0900, Sergey Senozhatsky wrote: > On (03/26/18 15:49), Minchan Kim wrote: > [..] > > +static ssize_t read_access_time(struct file *file, char __user *buf, > > + size_t count, loff_t *ppos) > > +{ > [..] >

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Tue, Mar 27, 2018 at 11:21:26AM +0900, Sergey Senozhatsky wrote: > On (03/26/18 15:49), Minchan Kim wrote: > [..] > > +static ssize_t read_access_time(struct file *file, char __user *buf, > > + size_t count, loff_t *ppos) > > +{ > [..] >

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Tue, Mar 27, 2018 at 10:47:34AM +0900, Sergey Senozhatsky wrote: > On (03/27/18 10:13), Sergey Senozhatsky wrote: > > On (03/27/18 10:03), Minchan Kim wrote: > > > On Tue, Mar 27, 2018 at 09:49:11AM +0900, Sergey Senozhatsky wrote: > > > > On (03/26/18 15:49), Min

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Tue, Mar 27, 2018 at 10:47:34AM +0900, Sergey Senozhatsky wrote: > On (03/27/18 10:13), Sergey Senozhatsky wrote: > > On (03/27/18 10:03), Minchan Kim wrote: > > > On Tue, Mar 27, 2018 at 09:49:11AM +0900, Sergey Senozhatsky wrote: > > > > On (03/26/18 15:49), Min

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Tue, Mar 27, 2018 at 09:49:11AM +0900, Sergey Senozhatsky wrote: > On (03/26/18 15:49), Minchan Kim wrote: > > zRam as swap is useful for small memory device. However, swap means > > those pages on zram are mostly cold pages due to VM's LRU algorithm. > > Espec

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Tue, Mar 27, 2018 at 09:49:11AM +0900, Sergey Senozhatsky wrote: > On (03/26/18 15:49), Minchan Kim wrote: > > zRam as swap is useful for small memory device. However, swap means > > those pages on zram are mostly cold pages due to VM's LRU algorithm. > > Espec

Re: [PATCH v6 0/5] add compression algorithm zBeWalgo

2018-03-26 Thread Minchan Kim
Hi Benjamin, Thanks for the nice present and good testing! I hope to grab a chance to test this shiny new algorithm but is busy this week. Hopefully, I will get that soon and feedback to you asap. Thanks. On Mon, Mar 26, 2018 at 10:31:40AM +0200, Benjamin Warnke wrote: > This patch series adds

Re: [PATCH v6 0/5] add compression algorithm zBeWalgo

2018-03-26 Thread Minchan Kim
Hi Benjamin, Thanks for the nice present and good testing! I hope to grab a chance to test this shiny new algorithm but is busy this week. Hopefully, I will get that soon and feedback to you asap. Thanks. On Mon, Mar 26, 2018 at 10:31:40AM +0200, Benjamin Warnke wrote: > This patch series adds

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Mon, Mar 26, 2018 at 10:15:11AM +0200, Greg KH wrote: > On Mon, Mar 26, 2018 at 03:49:51PM +0900, Minchan Kim wrote: > > +static int zram_debugfs_register(struct zram *zram) > > +{ > > + struct dentry *ret; > > + > > + if (!zram_debugfs_root) > > +

Re: [PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
On Mon, Mar 26, 2018 at 10:15:11AM +0200, Greg KH wrote: > On Mon, Mar 26, 2018 at 03:49:51PM +0900, Minchan Kim wrote: > > +static int zram_debugfs_register(struct zram *zram) > > +{ > > + struct dentry *ret; > > + > > + if (!zram_debugfs_root) > > +

[PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
n to catch cold pages of process with *pagemap* once part of heaps are swapped out. Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/block/zram/Kconfig| 11 +++ drivers/block/zram/zram_drv.c | 159 +++--- drivers/block/zram/zram_drv.h | 6 ++ 3 fi

[PATCH 1/2] zram: correct flag name of ZRAM_ACCESS

2018-03-26 Thread Minchan Kim
ZRAM_ACCESS is meant to lock a slot of zram so correct the name. Signed-off-by: Minchan Kim <minc...@kernel.org> --- drivers/block/zram/zram_drv.c | 4 ++-- drivers/block/zram/zram_drv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_d

[PATCH 2/2] zram: idle memory tracking

2018-03-26 Thread Minchan Kim
n to catch cold pages of process with *pagemap* once part of heaps are swapped out. Signed-off-by: Minchan Kim --- drivers/block/zram/Kconfig| 11 +++ drivers/block/zram/zram_drv.c | 159 +++--- drivers/block/zram/zram_drv.h | 6 ++ 3 files changed, 166 inserti

[PATCH 1/2] zram: correct flag name of ZRAM_ACCESS

2018-03-26 Thread Minchan Kim
ZRAM_ACCESS is meant to lock a slot of zram so correct the name. Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 4 ++-- drivers/block/zram/zram_drv.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram

Re: [PATCHv3 0/2] zsmalloc/zram: drop zram's max_zpage_size

2018-03-14 Thread Minchan Kim
e when > decide if the object is huge or not. > > v3: > - add pool param to zs_huge_class_size() [Minchan] > > Sergey Senozhatsky (2): > zsmalloc: introduce zs_huge_class_size() function > zram: drop max_zpage_size and use zs_huge_class_size() Both looks good to me. Ac

Re: [PATCHv3 0/2] zsmalloc/zram: drop zram's max_zpage_size

2018-03-14 Thread Minchan Kim
e when > decide if the object is huge or not. > > v3: > - add pool param to zs_huge_class_size() [Minchan] > > Sergey Senozhatsky (2): > zsmalloc: introduce zs_huge_class_size() function > zram: drop max_zpage_size and use zs_huge_class_size() Both looks good to me. Acked-by: Minchan Kim Thanks.

Re: [PATCHv2 2/2] zram: drop max_zpage_size and use zs_huge_class_size()

2018-03-13 Thread Minchan Kim
On Tue, Mar 13, 2018 at 11:18:13PM +0900, Sergey Senozhatsky wrote: > On (03/13/18 22:58), Minchan Kim wrote: > > > > If it is static, we can do this in zram_init? I believe it's more > > > > readable in that > > > > it's never changed betweens zram

Re: [PATCHv2 2/2] zram: drop max_zpage_size and use zs_huge_class_size()

2018-03-13 Thread Minchan Kim
On Tue, Mar 13, 2018 at 11:18:13PM +0900, Sergey Senozhatsky wrote: > On (03/13/18 22:58), Minchan Kim wrote: > > > > If it is static, we can do this in zram_init? I believe it's more > > > > readable in that > > > > it's never changed betweens zram

Re: [PATCHv2 2/2] zram: drop max_zpage_size and use zs_huge_class_size()

2018-03-13 Thread Minchan Kim
On Tue, Mar 13, 2018 at 07:24:37PM +0900, Sergey Senozhatsky wrote: > Hello Minchan, > > On (03/13/18 18:02), Minchan Kim wrote: > > Sorry for being late. > > I love this patchset! Just a minor below. > > :) > > [..] > > > + if (!huge_c

Re: [PATCHv2 2/2] zram: drop max_zpage_size and use zs_huge_class_size()

2018-03-13 Thread Minchan Kim
On Tue, Mar 13, 2018 at 07:24:37PM +0900, Sergey Senozhatsky wrote: > Hello Minchan, > > On (03/13/18 18:02), Minchan Kim wrote: > > Sorry for being late. > > I love this patchset! Just a minor below. > > :) > > [..] > > > + if (!huge_c

Re: [PATCHv2 2/2] zram: drop max_zpage_size and use zs_huge_class_size()

2018-03-13 Thread Minchan Kim
Hi Sergey, Sorry for being late. I love this patchset! Just a minor below. On Tue, Mar 06, 2018 at 04:06:39PM +0900, Sergey Senozhatsky wrote: > This patch removes ZRAM's enforced "huge object" value and uses > zsmalloc huge-class watermark instead, which makes more sense. > > TEST > - I used a

Re: [PATCHv2 2/2] zram: drop max_zpage_size and use zs_huge_class_size()

2018-03-13 Thread Minchan Kim
Hi Sergey, Sorry for being late. I love this patchset! Just a minor below. On Tue, Mar 06, 2018 at 04:06:39PM +0900, Sergey Senozhatsky wrote: > This patch removes ZRAM's enforced "huge object" value and uses > zsmalloc huge-class watermark instead, which makes more sense. > > TEST > - I used a

Re: [PATCH] mm/zsmalloc: strength reduce zspage_size calculation

2018-02-27 Thread Minchan Kim
Hi Joey, On Mon, Feb 26, 2018 at 02:21:26AM -1000, Joey Pabalinas wrote: > Replace the repeated multiplication in the main loop > body calculation of zspage_size with an equivalent > (and cheaper) addition operation. > > Signed-off-by: Joey Pabalinas > > 1 file

Re: [PATCH] mm/zsmalloc: strength reduce zspage_size calculation

2018-02-27 Thread Minchan Kim
Hi Joey, On Mon, Feb 26, 2018 at 02:21:26AM -1000, Joey Pabalinas wrote: > Replace the repeated multiplication in the main loop > body calculation of zspage_size with an equivalent > (and cheaper) addition operation. > > Signed-off-by: Joey Pabalinas > > 1 file changed, 2 insertions(+), 2

Re: [PATCH] mm:swap: do not check readahead flag with THP anon

2018-02-27 Thread Minchan Kim
On Wed, Feb 28, 2018 at 08:26:11AM +0900, Minchan Kim wrote: > Huang reported PG_readahead flag marked PF_NO_COMPOUND so that > we cannot use the flag for THP page. So, we need to check first > whether page is THP or not before using TestClearPageReadahead > in lookup_swap_cache. >

Re: [PATCH] mm:swap: do not check readahead flag with THP anon

2018-02-27 Thread Minchan Kim
On Wed, Feb 28, 2018 at 08:26:11AM +0900, Minchan Kim wrote: > Huang reported PG_readahead flag marked PF_NO_COMPOUND so that > we cannot use the flag for THP page. So, we need to check first > whether page is THP or not before using TestClearPageReadahead > in lookup_swap_cache. >

[PATCH] mm:swap: do not check readahead flag with THP anon

2018-02-27 Thread Minchan Kim
PG_readahead for newly allocated page because the allocated page is always a normal page, not THP at this moment. So let's clean it up, too. Cc: Hugh Dickins <hu...@google.com> Cc: "Huang, Ying" <ying.hu...@intel.com> Signed-off-by: Minchan Kim <minc...@kernel.org> --- mm/swap_s

[PATCH] mm:swap: do not check readahead flag with THP anon

2018-02-27 Thread Minchan Kim
PG_readahead for newly allocated page because the allocated page is always a normal page, not THP at this moment. So let's clean it up, too. Cc: Hugh Dickins Cc: "Huang, Ying" Signed-off-by: Minchan Kim --- mm/swap_state.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-)

Re: [PATCHv3 1/2] zsmalloc: introduce zs_huge_object() function

2018-02-25 Thread Minchan Kim
On Mon, Feb 26, 2018 at 03:50:35PM +0900, Sergey Senozhatsky wrote: > On (02/26/18 14:58), Minchan Kim wrote: > [..] > > > Right. The changes are pretty trivial, that's why I kept then in > > > 2 simple patches. Besides, I didn't want to mix zsmalloc and zram > >

Re: [PATCHv3 1/2] zsmalloc: introduce zs_huge_object() function

2018-02-25 Thread Minchan Kim
On Mon, Feb 26, 2018 at 03:50:35PM +0900, Sergey Senozhatsky wrote: > On (02/26/18 14:58), Minchan Kim wrote: > [..] > > > Right. The changes are pretty trivial, that's why I kept then in > > > 2 simple patches. Besides, I didn't want to mix zsmalloc and zram > >

Re: [PATCH] mm: Fix races between address_space dereference and free in page_evicatable

2018-02-25 Thread Minchan Kim
On Mon, Feb 26, 2018 at 02:38:04PM +0800, Huang, Ying wrote: > Minchan Kim <minc...@kernel.org> writes: > > > Hi Jan, > > > > On Mon, Feb 19, 2018 at 11:57:35AM +0100, Jan Kara wrote: > >> Hi Minchan, > >> > >> On Sun 18-02-18 18:22:45

Re: [PATCH] mm: Fix races between address_space dereference and free in page_evicatable

2018-02-25 Thread Minchan Kim
On Mon, Feb 26, 2018 at 02:38:04PM +0800, Huang, Ying wrote: > Minchan Kim writes: > > > Hi Jan, > > > > On Mon, Feb 19, 2018 at 11:57:35AM +0100, Jan Kara wrote: > >> Hi Minchan, > >> > >> On Sun 18-02-18 18:22:45, Minchan Kim wrote: > >

Re: [PATCHv3 1/2] zsmalloc: introduce zs_huge_object() function

2018-02-25 Thread Minchan Kim
Hi Sergey, On Mon, Feb 26, 2018 at 02:49:27PM +0900, Sergey Senozhatsky wrote: > > I think it's simple enough. :) > > Right. The changes are pretty trivial, that's why I kept then in > 2 simple patches. Besides, I didn't want to mix zsmalloc and zram > changes. As I said earlier, it's not thing

Re: [PATCHv3 1/2] zsmalloc: introduce zs_huge_object() function

2018-02-25 Thread Minchan Kim
Hi Sergey, On Mon, Feb 26, 2018 at 02:49:27PM +0900, Sergey Senozhatsky wrote: > > I think it's simple enough. :) > > Right. The changes are pretty trivial, that's why I kept then in > 2 simple patches. Besides, I didn't want to mix zsmalloc and zram > changes. As I said earlier, it's not thing

<    4   5   6   7   8   9   10   11   12   13   >