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

2018-05-15 Thread Minchan Kim
On Tue, May 15, 2018 at 09:46:01AM +0200, Martijn Coenen wrote: < snip > > >> About the unmap at runtime part, your commit message was a bit confusing. > >> You > >> said "every binder buffers should be mapped in advance by binder_mmap." > >> but I > >> think the new binder shrinker mechanism d

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

2018-05-14 Thread Minchan Kim
Hi Joel, Sorry for the late response. I was off. On Wed, May 09, 2018 at 04:19:41PM -0700, Joel Fernandes wrote: > On Wed, May 09, 2018 at 03:40:23PM +0900, Minchan Kim wrote: > > On Tue, May 08, 2018 at 04:08:13PM -0700, Joel Fernandes wrote: > > > On Tue, May 08, 2018 a

Re: [PATCH] mm/memblock: print memblock_remove

2018-05-09 Thread Minchan Kim
On Wed, May 09, 2018 at 10:12:14AM +0200, Michal Hocko wrote: > On Tue 08-05-18 19:42:23, Minchan Kim wrote: > > memblock_remove report is useful to see why MemTotal of /proc/meminfo > > between two kernels makes difference. > > > > Signed-off-by: Minchan Kim >

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

2018-05-08 Thread Minchan Kim
On Tue, May 08, 2018 at 04:08:13PM -0700, Joel Fernandes wrote: > On Tue, May 08, 2018 at 07:51:01PM +0900, Minchan Kim wrote: > > On Mon, May 07, 2018 at 10:28:29AM -0700, Joel Fernandes wrote: > > > On Mon, May 07, 2018 at 11:15:37PM +0900, Minchan Kim wrote: > > >

Re: [PATCH v10 12/25] mm: cache some VMA fields in the vm_fault structure

2018-05-08 Thread Minchan Kim
On Fri, May 04, 2018 at 11:10:54AM +0200, Laurent Dufour wrote: > On 03/05/2018 17:42, Minchan Kim wrote: > > On Thu, May 03, 2018 at 02:25:18PM +0200, Laurent Dufour wrote: > >> On 23/04/2018 09:42, Minchan Kim wrote: > >>> On Tue, Apr 17, 2018 at 04:33:18

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

2018-05-08 Thread Minchan Kim
On Mon, May 07, 2018 at 10:28:29AM -0700, Joel Fernandes wrote: > On Mon, May 07, 2018 at 11:15:37PM +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: linux-next: build warning after merge of the akpm-current tree

2018-05-08 Thread Minchan Kim
On Mon, May 07, 2018 at 09:47:54AM -0700, Randy Dunlap wrote: > On 05/07/2018 07:10 AM, Minchan Kim wrote: > > On Fri, May 04, 2018 at 08:39:43AM -0700, Randy Dunlap wrote: > >> On 05/03/2018 09:17 PM, Stephen Rothwell wrote: > >>> Hi Andrew, > >>>

[PATCH] mm/memblock: print memblock_remove

2018-05-08 Thread Minchan Kim
memblock_remove report is useful to see why MemTotal of /proc/meminfo between two kernels makes difference. Signed-off-by: Minchan Kim --- mm/memblock.c | 5 + 1 file changed, 5 insertions(+) diff --git a/mm/memblock.c b/mm/memblock.c index 5228f594b13c..03d48d8835ba 100644 --- a/mm

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

2018-05-07 Thread Minchan Kim
artijn Coenen Signed-off-by: Minchan Kim --- drivers/android/binder.c | 4 +++- drivers/android/binder_alloc.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index 4eab5be3d00f..7b8e96f60719 100644 --- a/dr

Re: linux-next: build warning after merge of the akpm-current tree

2018-05-07 Thread Minchan Kim
_t is signed. Also, %lu on i386 et al is for 32-bit longs. > I guess that "we" will need to cast ts.tv_sec to (s64) and use %lld to print > it > in order to satisfy other $arch. > > Andrew, want to add a fix-fix-fix patch? Thanks for the fix during I am absent, Andre

Re: [PATCH v10 12/25] mm: cache some VMA fields in the vm_fault structure

2018-05-03 Thread Minchan Kim
On Thu, May 03, 2018 at 02:25:18PM +0200, Laurent Dufour wrote: > On 23/04/2018 09:42, Minchan Kim wrote: > > On Tue, Apr 17, 2018 at 04:33:18PM +0200, Laurent Dufour wrote: > >> When handling speculative page fault, the vma->vm_flags and > >> vma->vm_page_prot fi

Re: [PATCH v10 08/25] mm: VMA sequence count

2018-05-01 Thread Minchan Kim
On Mon, Apr 30, 2018 at 05:14:27PM +0200, Laurent Dufour wrote: > > > On 23/04/2018 08:42, Minchan Kim wrote: > > On Tue, Apr 17, 2018 at 04:33:14PM +0200, Laurent Dufour wrote: > >> From: Peter Zijlstra > >> > >> Wrap the VMA modifications (

Re: [PATCH v10 06/25] mm: make pte_unmap_same compatible with SPF

2018-05-01 Thread Minchan Kim
On Mon, Apr 30, 2018 at 04:07:30PM +0200, Laurent Dufour wrote: > On 23/04/2018 08:31, Minchan Kim wrote: > > On Tue, Apr 17, 2018 at 04:33:12PM +0200, Laurent Dufour wrote: > >> pte_unmap_same() is making the assumption that the page table are still > >> around b

Re: [PATCH v10 12/25] mm: cache some VMA fields in the vm_fault structure

2018-04-23 Thread Minchan Kim
On Tue, Apr 17, 2018 at 04:33:18PM +0200, Laurent Dufour wrote: > When handling speculative page fault, the vma->vm_flags and > vma->vm_page_prot fields are read once the page table lock is released. So > there is no more guarantee that these fields would not change in our back. > They will be save

Re: [PATCH v10 09/25] mm: protect VMA modifications using VMA sequence count

2018-04-23 Thread Minchan Kim
On Tue, Apr 17, 2018 at 04:33:15PM +0200, Laurent Dufour wrote: > The VMA sequence count has been introduced to allow fast detection of > VMA modification when running a page fault handler without holding > the mmap_sem. > > This patch provides protection against the VMA modification done in : >

Re: [PATCH v10 08/25] mm: VMA sequence count

2018-04-22 Thread Minchan Kim
On Tue, Apr 17, 2018 at 04:33:14PM +0200, Laurent Dufour wrote: > From: Peter Zijlstra > > Wrap the VMA modifications (vma_adjust/unmap_page_range) with sequence > counts such that we can easily test if a VMA is changed. So, seqcount is to protect modifying all attributes of vma? > > The unmap

Re: [PATCH v10 06/25] mm: make pte_unmap_same compatible with SPF

2018-04-22 Thread Minchan Kim
On Tue, Apr 17, 2018 at 04:33:12PM +0200, Laurent Dufour wrote: > pte_unmap_same() is making the assumption that the page table are still > around because the mmap_sem is held. > This is no more the case when running a speculative page fault and > additional check must be made to ensure that the fi

Re: [PATCH v10 01/25] mm: introduce CONFIG_SPECULATIVE_PAGE_FAULT

2018-04-22 Thread Minchan Kim
Hi Laurent, I guess it's good timing to review. Guess LSF/MM goes so might change a lot since then. :) Anyway, I grap a time to review. On Tue, Apr 17, 2018 at 04:33:07PM +0200, Laurent Dufour wrote: > This configuration variable will be used to build the code needed to > handle speculative page

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

2018-04-20 Thread Minchan Kim
Hi Benjamin, Today I tried your new patchset but I couldn't go further due to below problem. Unfortunately, I don't have the time to look into. Could you check on it? Thanks. [ 169.597064] zram0: detected capacity change from 1073741824 to 0 [ 177.523268] zram0: detected capacity change from 0

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

2018-04-19 Thread Minchan Kim
On Fri, Apr 20, 2018 at 11:09:21AM +0900, Minchan Kim wrote: > On Wed, Apr 18, 2018 at 02:07:15PM -0700, Andrew Morton wrote: > > On Wed, 18 Apr 2018 10:26:36 +0900 Minchan Kim wrote: > > > > > Hi Andrew, > > > > > > On Tue, Apr 17, 2018 at 02:59:21PM

Re: [PATCH] mm:memcg: add __GFP_NOWARN in __memcg_schedule_kmem_cache_create

2018-04-19 Thread Minchan Kim
On Thu, Apr 19, 2018 at 08:40:05AM +0200, Michal Hocko wrote: > On Wed 18-04-18 11:58:00, David Rientjes wrote: > > On Wed, 18 Apr 2018, Michal Hocko wrote: > > > > > > Okay, no problem. However, I don't feel we need ratelimit at this > > > > moment. > > > > We can do when we got real report. Let

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

2018-04-19 Thread Minchan Kim
On Fri, Apr 20, 2018 at 11:18:34AM +0900, Sergey Senozhatsky wrote: > On (04/20/18 11:09), Minchan Kim wrote: > [..] > > > hm, OK, can we get this info into the changelog? > > > > No problem. I will add as follows, > > > > "I used the feature a few y

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

2018-04-19 Thread Minchan Kim
On Wed, Apr 18, 2018 at 02:07:15PM -0700, Andrew Morton wrote: > On Wed, 18 Apr 2018 10:26:36 +0900 Minchan Kim wrote: > > > Hi Andrew, > > > > On Tue, Apr 17, 2018 at 02:59:21PM -0700, Andrew Morton wrote: > > > On Mon, 16 Apr 2018 18:09:46 +0900 Minchan Kim w

Re: [PATCH] mm:memcg: add __GFP_NOWARN in __memcg_schedule_kmem_cache_create

2018-04-18 Thread Minchan Kim
On Wed, Apr 18, 2018 at 09:54:37AM +0200, Michal Hocko wrote: > On Wed 18-04-18 16:41:17, Minchan Kim wrote: > > On Wed, Apr 18, 2018 at 09:20:02AM +0200, Michal Hocko wrote: > > > On Wed 18-04-18 11:29:12, Minchan Kim wrote: > [...] > > > > Let's not make u

Re: [PATCH] mm:memcg: add __GFP_NOWARN in __memcg_schedule_kmem_cache_create

2018-04-18 Thread Minchan Kim
On Wed, Apr 18, 2018 at 09:20:02AM +0200, Michal Hocko wrote: > On Wed 18-04-18 11:29:12, Minchan Kim wrote: > > If there are heavy memory pressure, page allocation with __GFP_NOWAIT > > fails easily although it's order-0 request. > > I got below warni

[PATCH] mm:memcg: add __GFP_NOWARN in __memcg_schedule_kmem_cache_create

2018-04-17 Thread Minchan Kim
Vladimir Davydov Signed-off-by: Minchan Kim --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 448db08d97a0..671d07e73a3b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2200,7 +2200,

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

2018-04-17 Thread Minchan Kim
Hi Andrew, On Tue, Apr 17, 2018 at 02:59:21PM -0700, Andrew Morton wrote: > On Mon, 16 Apr 2018 18:09:46 +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 al

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

2018-04-16 Thread Minchan Kim
On Mon, Apr 16, 2018 at 11:37:27AM +0200, Greg Kroah-Hartman wrote: > On Mon, Apr 16, 2018 at 06:17:48PM +0900, Minchan Kim wrote: > > Hi Ganesh, > > > > On Tue, Apr 10, 2018 at 04:52:58PM +0800, Ganesh Mahendran wrote: > > > > < snip > > &

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

2018-04-16 Thread Minchan Kim
Hi Ganesh, On Tue, Apr 10, 2018 at 04:52:58PM +0800, Ganesh Mahendran wrote: < snip > > >> basepatch_v1 patch_v5 > >> --- > >> 91223.4 90560.2 89644.5 > >> 90520.3 8

Re: [PATCH v4 0/4] zram memory tracking

2018-04-16 Thread Minchan Kim
On Mon, Apr 16, 2018 at 04:42:18PM +0900, Sergey Senozhatsky wrote: > On (04/16/18 12:31), Minchan Kim wrote: > > Minchan Kim (4): > > zram: correct flag name of ZRAM_ACCESS > > zram: mark incompressible page as ZRAM_HUGE > > zram: record accessed second > &

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

2018-04-16 Thread Minchan Kim
exposes new stat for huge pages via mm_stat. Reviewed-by: Sergey Senozhatsky 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

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

2018-04-16 Thread Minchan Kim
uce memory footprint. Reviewed-by: Sergey Senozhatsky 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 77

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

2018-04-16 Thread Minchan Kim
ation. Reviewed-by: Sergey Senozhatsky 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

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

2018-04-16 Thread Minchan Kim
ed-by: Greg Kroah-Hartman Reviewed-by: Sergey Senozhatsky Signed-off-by: Minchan Kim --- Documentation/blockdev/zram.txt | 24 ++ drivers/block/zram/Kconfig | 14 +++- drivers/block/zram/zram_drv.c | 140 +--- drivers/block/zram/zram_drv.h | 5 ++ 4 file

[PATCH v5 0/4] zram memory tracking

2018-04-16 Thread Minchan Kim
: * 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 - Serge Minchan Kim (4): zram: correct flag name of ZRAM_ACCESS

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

2018-04-15 Thread Minchan Kim
On Sun, Apr 15, 2018 at 09:17:45PM -0700, Randy Dunlap wrote: > On 04/15/2018 08:31 PM, 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. > > Especially, once

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

2018-04-15 Thread Minchan Kim
uce memory 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 ---

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

2018-04-15 Thread Minchan Kim
ation. 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 1

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

2018-04-15 Thread Minchan Kim
ccessed. So above 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. Acked-by: Greg Kroah-Hartma

[PATCH v4 0/4] zram memory tracking

2018-04-15 Thread Minchan Kim
uffer - 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: correct flag name of ZRAM_ACCESS zram: mark incompressible page as ZRAM_HUGE zram: reco

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

2018-04-15 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 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Minchan Kim
On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > I was reported about suspicious growth of unreclaimable slabs > on some machines. I've found that it happens on machines > with low memory pressure, and these unreclaimable slabs > are external names attached to dentries. > > Extern

Re: [PATCH v2 0/2] Fix __GFP_ZERO vs constructor

2018-04-11 Thread Minchan Kim
Matthew, Please Cced relevant people so they know what's going on the problem they spent on much time. Everyone doesn't keep an eye on mailing list. On Tue, Apr 10, 2018 at 11:03:18PM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox > > v1->v2: > - Added review/ack tags (thanks!) > - Switc

Re: [PATCH] mm, slab: reschedule cache_reap() on the same CPU

2018-04-11 Thread Minchan Kim
On Wed, Apr 11, 2018 at 09:00:07AM +0200, Vlastimil Babka wrote: > cache_reap() is initially scheduled in start_cpu_timer() via > schedule_delayed_work_on(). But then the next iterations are scheduled via > schedule_delayed_work(), i.e. using WORK_CPU_UNBOUND. > > Thus since commit ef557180447f ("

Re: [PATCH 2/2] page cache: Mask off unwanted GFP flags

2018-04-10 Thread Minchan Kim
ier in the callchain. > > Fixes: 19f99cee206c ("f2fs: add core inode operations") Why this patch fix 19f99cee206c instead of 449dd6984d0e? F2FS doesn't have any problem before introducing 449dd6984d0e? > Reported-by: Minchan Kim > Signed-off-by: Matthew Wilcox > Cc: sta...

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

2018-04-10 Thread Minchan Kim
ECLAIM_MASK); > > correct? > Looks much better. Finally, it seems everyone agree on this. However, I won't include warning part of slab allocator because I think it's improve stuff not bug fix so it could be separted. If anyone really want to include it in this stable patch, pl

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

2018-04-10 Thread Minchan Kim
On Tue, Apr 10, 2018 at 12:28:45PM +0200, Jan Kara wrote: > On Tue 10-04-18 11:32:41, Michal Hocko wrote: > > On Tue 10-04-18 10:55:31, Jan Kara wrote: > > > On Tue 10-04-18 10:22:43, Michal Hocko wrote: > > > > On Mon 09-04-18 10:58:15, Minchan Kim wrote: > >

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

2018-04-09 Thread Minchan Kim
I will fix and resend tomorrow. Huge thanks, Sergey! On Tue, Apr 10, 2018 at 09:41:09AM +0900, Sergey Senozhatsky wrote: > I think zram_debugfs_unregister() is called both from zram_remove() and > from destroy_devices(), which explodes: > > [ 1906.467981] BUG: unable to handle kernel NULL pointer

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

2018-04-09 Thread Minchan Kim
On Tue, Apr 10, 2018 at 09:03:05AM +0900, Sergey Senozhatsky wrote: > Hi Minchan, > > On (04/09/18 14:54), Minchan Kim wrote: > > +static long long ns2usecs(u64 nsec) > > +{ > > + nsec += 500; > > + do_div(nsec, 1000); > > + return nsec; > >

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

2018-04-09 Thread Minchan Kim
On Mon, Apr 09, 2018 at 07:41:52PM -0700, Matthew Wilcox wrote: > On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > > @@ -522,7 +532,7 @@ EXPORT_SYMBOL(radix_tree_preload); > > */ > > int radix_tree_maybe_preload(gfp_t gfp_mask) > > { > > - if

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

2018-04-09 Thread Minchan Kim
On Tue, Apr 10, 2018 at 11:33:39AM +0900, Minchan Kim wrote: > 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: > > &

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

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 v5] ANDROID: binder: change down_write to down_read

2018-04-08 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, Ganes

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

2018-04-08 Thread Minchan Kim
ation. 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 1

[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
so it was written 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

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

2018-04-08 Thread Minchan Kim
ccessed. So above 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 S

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

2018-04-08 Thread Minchan Kim
uce memory 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 ---

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

[PATCH] mm: workingset: fix NULL ptr dereference

2018-04-08 Thread Minchan Kim
de can have !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:

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

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
v4.16-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-ra

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

2018-03-28 Thread Minchan Kim
Reviewed-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

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

2018-03-28 Thread Minchan Kim
artijn Coenen 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-

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 shou

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

2018-03-28 Thread Minchan Kim
artijn Coenen 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.

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

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

2018-03-27 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
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

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-26 Thread Minchan Kim
ation. 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 1

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

2018-03-26 Thread Minchan Kim
uce memory 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 ---

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

2018-03-26 Thread Minchan Kim
s last accessed. 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:

[PATCH v2 0/4] zram memory tracking

2018-03-26 Thread Minchan Kim
so it was written 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 seco

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

2018-03-26 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 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. > > Espe

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) > > +

[PATCH 2/2] zram: idle memory tracking

2018-03-25 Thread Minchan Kim
this information 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 chang

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

2018-03-25 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
value 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 between

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

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

<    2   3   4   5   6   7   8   9   10   11   >