[PATCH v8 1/4] mm/madvise: pass task and mm to do_madvise

2020-06-22 Thread Minchan Kim
io_uring] Link: http://lkml.kernel.org/r/20200423145215.72666-1-minc...@kernel.org [a...@linux-foundation.org: fix it for upstream changes] [a...@linux-foundation.org: whoops] [rdun...@infradead.org: add missing includes] Link: http://lkml.kernel.org/r/20200302193630.68771-2-minc...@kernel.org Sign

[PATCH v8 2/4] pid: move pidfd_get_pid() to pid.c

2020-06-22 Thread Minchan Kim
process_madvise syscall needs pidfd_get_pid function to translate pidfd to pid so this patch move the function to kernel/pid.c. Link: http://lkml.kernel.org/r/20200302193630.68771-5-minc...@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Suren Baghdasaryan Suggested-by: Alexander Duyck

[PATCH v8 0/4] introduce memory hinting API for external process

2020-06-22 Thread Minchan Kim
* fix syscall number - SeongJae * use get_pid_task - Kirill Tkhai * extend API to support pid as well as pidfd - Kirill Tkhai Minchan Kim (4): mm/madvise: pass task and mm to do_madvise pid: move pidfd_get_pid() to pid.c mm/madvise: introduce process_madvise() syscall: an external memory

Re: [PATCH] page_alloc: consider highatomic reserve in wmartermark fast

2020-06-12 Thread Minchan Kim
On Fri, Jun 12, 2020 at 04:03:41PM +0900, Jaewon Kim wrote: > > > On 2020년 06월 12일 15:55, Minchan Kim wrote: > > On Thu, Jun 11, 2020 at 05:54:12PM +0900, Jaewon Kim wrote: > >> > >> On 2020년 06월 10일 10:21, Minchan Kim wrote: > >>> Hi Jaewon, > &g

Re: [PATCH] page_alloc: consider highatomic reserve in wmartermark fast

2020-06-12 Thread Minchan Kim
On Thu, Jun 11, 2020 at 05:54:12PM +0900, Jaewon Kim wrote: > > > On 2020년 06월 10일 10:21, Minchan Kim wrote: > > Hi Jaewon, > > > > On Tue, Jun 09, 2020 at 06:51:28PM +0900, Jaewon Kim wrote: > >> zone_watermark_fast was introduced by commit 48ee5f3696f6 (&quo

Re: [PATCH] page_alloc: consider highatomic reserve in wmartermark fast

2020-06-09 Thread Minchan Kim
Hi Jaewon, On Tue, Jun 09, 2020 at 06:51:28PM +0900, Jaewon Kim wrote: > zone_watermark_fast was introduced by commit 48ee5f3696f6 ("mm, > page_alloc: shortcut watermark checks for order-0 pages"). The commit > simply checks if free pages is bigger than watermark without additional > calculation

Re: [PATCH v3 7/7] zram: Use local lock to protect per-CPU data

2020-05-29 Thread Minchan Kim
On non RT > kernels this maps to preempt_disable() as before, i.e. no functional > change. > > [bigeasy: Use local_lock(), description, drop reordering] > > Cc: Minchan Kim > Cc: Nitin Gupta > Cc: Sergey Senozhatsky > Signed-off-by: Mike Galbraith > Signed-off-by: Sebastian Andrzej Siewior Acked-by: Minchan Kim

Re: [PATCH v3 6/7] zram: Allocate struct zcomp_strm as per-CPU memory

2020-05-29 Thread Minchan Kim
nd a pointer dereference. This also simplifies the > addition of a local_lock to struct zcomp_strm. > > Allocate zcomp::stream directly as per-CPU memory. > > Cc: Minchan Kim > Cc: Nitin Gupta > Cc: Sergey Senozhatsky > Signed-off-by: Sebastian Andrzej Siewior Acked-by: Minchan Kim Looks good to me.

Re: [PATCH] mm: use only pidfd for process_madvise syscall

2020-05-19 Thread Minchan Kim
On Tue, May 19, 2020 at 09:19:56AM -0700, Minchan Kim wrote: > Hi Christian, > > On Tue, May 19, 2020 at 09:45:18AM +0200, Christian Brauner wrote: > > On Fri, May 15, 2020 at 06:20:55PM -0700, Minchan Kim wrote: > > > Based on discussion[1], people didn't feel we need t

Re: [PATCH] mm: use only pidfd for process_madvise syscall

2020-05-19 Thread Minchan Kim
Hi Christian, On Tue, May 19, 2020 at 09:45:18AM +0200, Christian Brauner wrote: > On Fri, May 15, 2020 at 06:20:55PM -0700, Minchan Kim wrote: > > Based on discussion[1], people didn't feel we need to support both > > pid and pidfd for every new coming API[2] so this patch keeps

Re: [PATCH] mm: use only pidfd for process_madvise syscall

2020-05-18 Thread Minchan Kim
Hi Andrew, On Mon, May 18, 2020 at 04:06:56PM -0700, Andrew Morton wrote: > On Mon, 18 May 2020 14:13:50 -0700 Minchan Kim wrote: > > > Andrew, I sent this patch without folding into previous syscall introducing > > patches because it could be arguable. If you want to

Re: [PATCH] mm: use only pidfd for process_madvise syscall

2020-05-18 Thread Minchan Kim
On Mon, May 18, 2020 at 12:22:56PM -0700, Suren Baghdasaryan wrote: > On Fri, May 15, 2020 at 6:21 PM Minchan Kim wrote: > > > > Based on discussion[1], people didn't feel we need to support both > > pid and pidfd for every new coming API[2] so this patch keeps only >

[PATCH] mm: use only pidfd for process_madvise syscall

2020-05-15 Thread Minchan Kim
-3359-c4ab-fbec-859e8186c...@virtuozzo.com/ Signed-off-by: Minchan Kim --- mm/madvise.c | 42 +- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/mm/madvise.c b/mm/madvise.c index d3fbbe52d230..35c9b220146a 100644 --- a/mm/madvise.c +++ b/mm

Re: [PATCH v7 5/7] mm: support both pid and pidfd for process_madvise

2020-05-09 Thread Minchan Kim
Hi Christian, On Sat, May 09, 2020 at 02:48:17PM +0200, Christian Brauner wrote: > On Fri, May 08, 2020 at 04:04:15PM -0700, Andrew Morton wrote: > > On Fri, 8 May 2020 11:36:53 -0700 Minchan Kim wrote: > > > > > > > > ... > > > > > > P

Re: [PATCH v7 5/7] mm: support both pid and pidfd for process_madvise

2020-05-08 Thread Minchan Kim
On Tue, Mar 10, 2020 at 05:42:51PM -0700, Minchan Kim wrote: > On Fri, Mar 06, 2020 at 12:14:19PM +0100, Vlastimil Babka wrote: > > On 3/2/20 8:36 PM, Minchan Kim wrote: > > > There is a demand[1] to support pid as well pidfd for process_madvise > > > to reduce unnec

Re: [PATCH v7 2/7] mm: introduce external memory hinting API

2020-05-08 Thread Minchan Kim
On Thu, Mar 12, 2020 at 01:23:39PM -0700, Minchan Kim wrote: > On Thu, Mar 12, 2020 at 01:40:26PM +0100, Vlastimil Babka wrote: > > On 3/10/20 11:20 PM, Minchan Kim wrote: > > > On Thu, Mar 05, 2020 at 07:15:10PM +0100, Vlastimil Babka wrote: > > >> On 3/2

Re: [PATCH v7 1/7] mm: pass task and mm to do_madvise

2020-05-08 Thread Minchan Kim
On Thu, Mar 05, 2020 at 04:48:12PM +0100, Vlastimil Babka wrote: > On 3/2/20 8:36 PM, Minchan Kim wrote: > > In upcoming patches, do_madvise will be called from external process > > context so we shouldn't asssume "current" is always hinted process's > > task_st

Re: linux-next: Tree for Apr 28

2020-04-28 Thread Minchan Kim
CALL_DEFINEx' >66 | COMPAT_SYSCALL_DEFINEx(6, _##name, __VA_ARGS__) > | ^~ > mm/madvise.c:1314:1: note: in expansion of macro 'COMPAT_SYSCALL_DEFINE6' > 1314 | COMPAT_SYSCALL_DEFINE6(process_madvise, int, which, compat_pid_t, > upid, > | ^~~~~~ > make[2]: *** [sc

Re: [PATCH 0/3] Allow ZRAM to use any zpool-compatible backend

2019-10-15 Thread Minchan Kim
On Tue, Oct 15, 2019 at 09:39:35AM +0200, Vitaly Wool wrote: > Hi Minchan, > > On Mon, Oct 14, 2019 at 6:41 PM Minchan Kim wrote: > > > > On Thu, Oct 10, 2019 at 11:04:14PM +0300, Vitaly Wool wrote: > > > The coming patchset is a new take on the old issue: ZRAM can

Re: [PATCH 0/3] Allow ZRAM to use any zpool-compatible backend

2019-10-14 Thread Minchan Kim
On Thu, Oct 10, 2019 at 11:04:14PM +0300, Vitaly Wool wrote: > The coming patchset is a new take on the old issue: ZRAM can currently be > used only with zsmalloc even though this may not be the optimal combination > for some configurations. The previous (unsuccessful) attempt dates back to >

Re: [PATCH] mm: annotate refault stalls from swap_readpage

2019-10-10 Thread Minchan Kim
On Thu, Oct 10, 2019 at 03:17:47PM -0400, Johannes Weiner wrote: > On Thu, Oct 10, 2019 at 08:21:34AM -0700, Minchan Kim wrote: > > From: Minchan Kim > > > > If block device supports rw_page operation, it doesn't submit bio > > so annotation in submit_bio for

[PATCH] mm: annotate refault stalls from swap_readpage

2019-10-10 Thread Minchan Kim
From: Minchan Kim If block device supports rw_page operation, it doesn't submit bio so annotation in submit_bio for refault stall doesn't work. It happens with zram in android, especially swap read path which could consume CPU cycle for decompress. It is also a problem for zswap which uses

Re: [PATCH] fs: annotate refault stalls from bdev_read_page

2019-10-09 Thread Minchan Kim
On Wed, Oct 09, 2019 at 03:25:10PM -0700, Shakeel Butt wrote: > On Wed, Oct 9, 2019 at 2:19 PM Minchan Kim wrote: > > > > From: Minchan Kim > > > > If block device supports rw_page operation, it doesn't submit bio > > so annotation in submit_bio for refault s

[PATCH] fs: annotate refault stalls from bdev_read_page

2019-10-09 Thread Minchan Kim
From: Minchan Kim If block device supports rw_page operation, it doesn't submit bio so annotation in submit_bio for refault stall doesn't work. It happens with zram in android, especially swap read path which could consume CPU cycle for decompress. Annotate bdev_read_page() to account

Re: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages

2019-09-12 Thread Minchan Kim
On Mon, Sep 09, 2019 at 10:40:29AM +0200, Michal Hocko wrote: > On Thu 05-09-19 01:44:12, sunqiuyang wrote: > > > > > > > > > From: Michal Hocko [mho...@kernel.org] > > > Sent: Wednesday, September 04, 2019 20:52 > > > To: sunqiuyang > > > Cc:

Re: [PATCH 1/1] mm/migrate: fix list corruption in migration of non-LRU movable pages

2019-09-10 Thread Minchan Kim
On Tue, Sep 03, 2019 at 04:27:46PM +0800, sunqiuyang wrote: > From: Qiuyang Sun > > Currently, after a page is migrated, it > 1) has its PG_isolated flag cleared in move_to_new_page(), and > 2) is deleted from its LRU list (cc->migratepages) in unmap_and_move(). > However, between steps 1) and

Re: [mm] 755d6edc1a: will-it-scale.per_process_ops -4.1% regression

2019-08-06 Thread Minchan Kim
On Tue, Aug 06, 2019 at 10:04:15AM +0200, Michal Hocko wrote: > On Tue 06-08-19 15:05:47, kernel test robot wrote: > > Greeting, > > > > FYI, we noticed a -4.1% regression of will-it-scale.per_process_ops due to > > commit: > > I have to confess I cannot make much sense from numbers because

Re: [PATCH] mm: release the spinlock on zap_pte_range

2019-08-06 Thread Minchan Kim
On Wed, Jul 31, 2019 at 09:21:01AM +0200, Michal Hocko wrote: > On Wed 31-07-19 14:44:47, Minchan Kim wrote: > > On Tue, Jul 30, 2019 at 02:57:51PM +0200, Michal Hocko wrote: > > > [Cc Nick - the email thread starts > > > http://lkml.kernel.org/r/20190729071037.

Re: [PATCH 2/2] mm/zsmalloc.c: Fix race condition in zs_destroy_pool

2019-08-05 Thread Minchan Kim
On Mon, Aug 05, 2019 at 10:34:41AM -0700, Henry Burns wrote: > On Sun, Aug 4, 2019 at 9:28 PM Minchan Kim wrote: > > > > Hi Henry, > > > > On Thu, Aug 01, 2019 at 06:53:32PM -0700, Henry Burns wrote: > > > In zs_destroy_pool() we call flush_work(>free_wor

Re: [PATCH 2/2] mm/zsmalloc.c: Fix race condition in zs_destroy_pool

2019-08-04 Thread Minchan Kim
Hi Henry, On Thu, Aug 01, 2019 at 06:53:32PM -0700, Henry Burns wrote: > In zs_destroy_pool() we call flush_work(>free_work). However, we > have no guarantee that migration isn't happening in the background > at that time. > > Since migration can't directly free pages, it relies on free_work >

Re: [PATCH 1/2] mm/zsmalloc.c: Migration can leave pages in ZS_EMPTY indefinitely

2019-08-04 Thread Minchan Kim
the > sequence to a new putback_zspage_deferred() function which both > zs_page_migrate() and zs_page_putback() call. > > Signed-off-by: Henry Burns Cc: [4.8+] Acked-by: Minchan Kim Below a just trivial: > --- > mm/zsmalloc.c | 30 -- > 1

Re: kernel BUG at mm/vmscan.c:LINE! (2)

2019-08-02 Thread Minchan Kim
37c60 > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1564585460 > > The bug was bisected to: > > commit 06a833a1167e9cbb43a9a4317ec24585c6ec85cb > Author: Minchan Kim > Date: Sat Jul 27 05:12:38 2019 + > > mm: introduce MADV_PAGEOUT >

Re: "mm: account nr_isolated_xxx in [isolate|putback]_lru_page" breaks OOM with swap

2019-08-01 Thread Minchan Kim
On Wed, Jul 31, 2019 at 02:18:00PM -0400, Qian Cai wrote: > On Wed, 2019-07-31 at 12:09 -0400, Qian Cai wrote: > > On Wed, 2019-07-31 at 14:34 +0900, Minchan Kim wrote: > > > On Tue, Jul 30, 2019 at 12:25:28PM -0400, Qian Cai wrote: > > > > OOM workloads with

Re: [PATCH] mm: release the spinlock on zap_pte_range

2019-07-31 Thread Minchan Kim
On Tue, Jul 30, 2019 at 12:42:07PM -0700, Andrew Morton wrote: > On Mon, 29 Jul 2019 17:20:52 +0900 Minchan Kim wrote: > > > > > @@ -1022,7 +1023,16 @@ static unsigned long zap_pte_range(struct > > > > mmu_gather *tlb, > > >

Re: [PATCH] mm: release the spinlock on zap_pte_range

2019-07-30 Thread Minchan Kim
e still need it and why > SetPageReferenced cannot be used instead. More below.] > > On Tue 30-07-19 21:39:35, Minchan Kim wrote: > > On Tue, Jul 30, 2019 at 02:32:37PM +0200, Michal Hocko wrote: > > > On Tue 30-07-19 21:11:10, Minchan Kim wrote: > > > > On Mon, Jul

Re: "mm: account nr_isolated_xxx in [isolate|putback]_lru_page" breaks OOM with swap

2019-07-30 Thread Minchan Kim
t+0x18/0x38 Thanks for the testing! No surprise the patch make some bugs because it's rather tricky. Could you test this patch? >From b31667210dd747f4d8aeb7bdc1f5c14f1f00bff5 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Wed, 31 Jul 2019 14:18:01 +0900 Subject: [PATCH] mm: decrease NR_ISOALTED

Re: [PATCH] mm: release the spinlock on zap_pte_range

2019-07-30 Thread Minchan Kim
On Tue, Jul 30, 2019 at 02:32:37PM +0200, Michal Hocko wrote: > On Tue 30-07-19 21:11:10, Minchan Kim wrote: > > On Mon, Jul 29, 2019 at 10:35:15AM +0200, Michal Hocko wrote: > > > On Mon 29-07-19 17:20:52, Minchan Kim wrote: > > > > On Mon, Jul 29, 2019 at 09:45:

Re: [PATCH] mm: release the spinlock on zap_pte_range

2019-07-30 Thread Minchan Kim
On Mon, Jul 29, 2019 at 10:35:15AM +0200, Michal Hocko wrote: > On Mon 29-07-19 17:20:52, Minchan Kim wrote: > > On Mon, Jul 29, 2019 at 09:45:23AM +0200, Michal Hocko wrote: > > > On Mon 29-07-19 16:10:37, Minchan Kim wrote: > > > > In our testing(carmera re

Re: [PATCH] mm: release the spinlock on zap_pte_range

2019-07-29 Thread Minchan Kim
On Mon, Jul 29, 2019 at 09:45:23AM +0200, Michal Hocko wrote: > On Mon 29-07-19 16:10:37, Minchan Kim wrote: > > In our testing(carmera recording), Miguel and Wei found unmap_page_range > > takes above 6ms with preemption disabled easily. When I see that, the > > reason i

[PATCH] mm: release the spinlock on zap_pte_range

2019-07-29 Thread Minchan Kim
in the time because it could make frame drop or glitch audio problem. This patch adds preemption point like coyp_pte_range. Reported-by: Miguel de Dios Reported-by: Wei Wang Cc: Michal Hocko Cc: Johannes Weiner Cc: Mel Gorman Signed-off-by: Minchan Kim --- mm/memory.c | 19 --- 1

Re: [PATCH v7 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-07-25 Thread Minchan Kim
Hi Andrew, It's the resend with fixing build errors kbuildbot reported. Please take it this version to get more test coverage. Thanks. On Fri, Jul 26, 2019 at 11:34:30AM +0900, Minchan Kim wrote: > This patch is part of previous series: > https://lore.kernel.org/lkml/20190531064313.19

[PATCH v7 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-07-25 Thread Minchan Kim
rg * v1 - http://lore.kernel.org/lkml/20190603053655.127730-1-minc...@kernel.org Minchan Kim (5): mm: introduce MADV_COLD mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM mm: account nr_isolated_xxx in [isolate|putback]_lru_page mm: introduce MADV_PAGEOUT mm: factor out common parts

[PATCH v7 5/5] mm: factor out common parts between MADV_COLD and MADV_PAGEOUT

2019-07-25 Thread Minchan Kim
There are many common parts between MADV_COLD and MADV_PAGEOUT. This patch factor them out to save code duplication. Suggested-by: Johannes Weiner Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- mm/madvise.c | 194 --- 1 file changed, 46

[PATCH v7 2/5] mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM

2019-07-25 Thread Minchan Kim
for next patch. * RFCv1 * use ignore_referecnes as parameter name - hannes Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minchan Kim --- mm/vmscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 82e1e229eef21

[PATCH v7 4/5] mm: introduce MADV_PAGEOUT

2019-07-25 Thread Minchan Kim
] https://lore.kernel.org/lkml/20190710194719.gs29...@dhcp22.suse.cz/ Cc: linux-a...@vger.kernel.org Cc: James E.J. Bottomley Cc: Richard Henderson Cc: Ralf Baechle Cc: Chris Zankel Reported-by: kbuild test robot Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- arch/alpha/include/uapi/asm

[PATCH v7 3/5] mm: account nr_isolated_xxx in [isolate|putback]_lru_page

2019-07-25 Thread Minchan Kim
://lkml.kernel.org/r/20190531165927.ga20...@cmpxchg.org Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- mm/compaction.c | 2 -- mm/gup.c| 7 +-- mm/khugepaged.c | 3 --- mm/memory-failure.c | 3 --- mm/memory_hotplug.c

[PATCH v7 1/5] mm: introduce MADV_COLD

2019-07-25 Thread Minchan Kim
Revise the description - surenb * Renaming from MADV_WARM to MADV_COOL - surenb Cc: linux-a...@vger.kernel.org Cc: James E.J. Bottomley Cc: Richard Henderson Cc: Ralf Baechle Cc: Chris Zankel Reported-by: kbuild test robot Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minch

Re: [PATCH] mm: replace list_move_tail() with add_page_to_lru_list_tail()

2019-07-24 Thread Minchan Kim
Hi Andrew, On Wed, Jul 24, 2019 at 07:32:49PM -0700, Andrew Morton wrote: > On Tue, 16 Jul 2019 15:24:36 -0600 Yu Zhao wrote: > > > This is a cleanup patch that replaces two historical uses of > > list_move_tail() with relatively recent add_page_to_lru_list_tail(). > > > > Looks OK to me. >

[PATCH v6 3/5] mm: account nr_isolated_xxx in [isolate|putback]_lru_page

2019-07-23 Thread Minchan Kim
://lkml.kernel.org/r/20190531165927.ga20...@cmpxchg.org Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- mm/compaction.c | 2 -- mm/gup.c| 7 +-- mm/khugepaged.c | 3 --- mm/memory-failure.c | 3 --- mm/memory_hotplug.c

[PATCH v6 5/5] mm: factor out common parts between MADV_COLD and MADV_PAGEOUT

2019-07-23 Thread Minchan Kim
There are many common parts between MADV_COLD and MADV_PAGEOUT. This patch factor them out to save code duplication. Suggested-by: Johannes Weiner Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- mm/madvise.c | 193 --- 1 file changed, 46

[PATCH v6 4/5] mm: introduce MADV_PAGEOUT

2019-07-23 Thread Minchan Kim
factoring out isolate logic - hannes * RFCv1 * rename from MADV_COLD to MADV_PAGEOUT - hannes * bail out if process is being killed - Hillf * fix reclaim_pages bugs - Hillf [1] https://lore.kernel.org/lkml/20190710194719.gs29...@dhcp22.suse.cz/ Acked-by: Michal Hocko Signed-off-by: Minchan Kim

[PATCH v6 2/5] mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM

2019-07-23 Thread Minchan Kim
for next patch. * RFCv1 * use ignore_referecnes as parameter name - hannes Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minchan Kim --- mm/vmscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index f4fd02ae233ef

[PATCH v6 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-07-23 Thread Minchan Kim
- http://lore.kernel.org/lkml/20190711012528.176050-1-minc...@kernel.org * v3 - http://lore.kernel.org/lkml/20190627115405.255259-1-minc...@kernel.org * v2 - http://lore.kernel.org/lkml/20190610111252.239156-1-minc...@kernel.org * v1 - http://lore.kernel.org/lkml/20190603053655.127730-1-minc...@kernel.org Minchan

[PATCH v6 1/5] mm: introduce MADV_COLD

2019-07-23 Thread Minchan Kim
V_COOL to MADV_COLD - hannes * internal review * use clear_page_youn in deactivate_page - joelaf * Revise the description - surenb * Renaming from MADV_WARM to MADV_COOL - surenb Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minchan Kim --- include/linux/

Re: [PATCH v1 1/2] mm/page_idle: Add support for per-pid page_idle using virtual indexing

2019-07-23 Thread Minchan Kim
Hi Joel, On Mon, Jul 22, 2019 at 05:32:04PM -0400, Joel Fernandes (Google) wrote: > The page_idle tracking feature currently requires looking up the pagemap > for a process followed by interacting with /sys/kernel/mm/page_idle. > This is quite cumbersome and can be error-prone too. If between

Re: [PATCH v5 1/5] mm: introduce MADV_COLD

2019-07-22 Thread Minchan Kim
On Wed, Jul 17, 2019 at 03:14:57PM -0700, Suren Baghdasaryan wrote: > Hi Minchan, > Couple comments inline. > Thanks! > > On Sun, Jul 14, 2019 at 4:34 PM Minchan Kim wrote: > > > > When a process expects no accesses to a certain memory range, it could > > give a

[PATCH v5 3/5] mm: account nr_isolated_xxx in [isolate|putback]_lru_page

2019-07-14 Thread Minchan Kim
://lkml.kernel.org/r/20190531165927.ga20...@cmpxchg.org Suggested-by: Johannes Weiner Acked-by: Johannes Weiner Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- mm/compaction.c | 2 -- mm/gup.c| 7 +-- mm/khugepaged.c | 3 --- mm/memory-failure.c | 3 --- mm/memory_hotplug.c

[PATCH v5 5/5] mm: factor out common parts between MADV_COLD and MADV_PAGEOUT

2019-07-14 Thread Minchan Kim
There are many common parts between MADV_COLD and MADV_PAGEOUT. This patch factor them out to save code duplication. Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- mm/madvise.c | 193 --- 1 file changed, 46 insertions(+), 147 deletions

[PATCH v5 4/5] mm: introduce MADV_PAGEOUT

2019-07-14 Thread Minchan Kim
factoring out isolate logic - hannes * RFCv1 * rename from MADV_COLD to MADV_PAGEOUT - hannes * bail out if process is being killed - Hillf * fix reclaim_pages bugs - Hillf [1] https://lore.kernel.org/lkml/20190710194719.gs29...@dhcp22.suse.cz/ Acked-by: Michal Hocko Signed-off-by: Minchan Kim

[PATCH v5 2/5] mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM

2019-07-14 Thread Minchan Kim
for next patch. * RFCv1 * use ignore_referecnes as parameter name - hannes Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minchan Kim --- mm/vmscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a0301edd8d03

[PATCH v5 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-07-14 Thread Minchan Kim
rg/lkml/20190627115405.255259-1-minc...@kernel.org * v2 - http://lore.kernel.org/lkml/20190610111252.239156-1-minc...@kernel.org * v1 - http://lore.kernel.org/lkml/20190603053655.127730-1-minc...@kernel.org Minchan Kim (5): mm: introduce MADV_COLD mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REF

[PATCH v5 1/5] mm: introduce MADV_COLD

2019-07-14 Thread Minchan Kim
e_youn in deactivate_page - joelaf * Revise the description - surenb * Renaming from MADV_WARM to MADV_COOL - surenb Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minchan Kim --- include/linux/swap.h | 1 + include/uapi/asm-generic/mman-common.h | 1

Re: [PATCH v4 4/4] mm: introduce MADV_PAGEOUT

2019-07-14 Thread Minchan Kim
On Fri, Jul 12, 2019 at 09:58:09AM -0400, Johannes Weiner wrote: > On Fri, Jul 12, 2019 at 02:18:28PM +0900, Minchan Kim wrote: > > Hi Johannes, > > > > On Thu, Jul 11, 2019 at 02:42:23PM -0400, Johannes Weiner wrote: > > > On Thu, Jul 11, 2019 at 10:25

Re: [PATCH v4 4/4] mm: introduce MADV_PAGEOUT

2019-07-11 Thread Minchan Kim
Hi Johannes, On Thu, Jul 11, 2019 at 02:42:23PM -0400, Johannes Weiner wrote: > On Thu, Jul 11, 2019 at 10:25:28AM +0900, Minchan Kim wrote: > > @@ -480,6 +482,198 @@ static long madvise_cold(struct vm_area_struct *vma, > > return 0; > > } > > > > +sta

[PATCH v4 4/4] mm: introduce MADV_PAGEOUT

2019-07-10 Thread Minchan Kim
to MADV_PAGEOUT - hannes * bail out if process is being killed - Hillf * fix reclaim_pages bugs - Hillf [1] https://lore.kernel.org/lkml/20190710194719.gs29...@dhcp22.suse.cz/ Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- include/linux/swap.h | 1 + include/uapi/asm-generic

[PATCH v4 3/4] mm: account nr_isolated_xxx in [isolate|putback]_lru_page

2019-07-10 Thread Minchan Kim
://lkml.kernel.org/r/20190531165927.ga20...@cmpxchg.org Acked-by: Michal Hocko Suggested-by: Johannes Weiner Signed-off-by: Minchan Kim --- mm/compaction.c | 2 -- mm/gup.c| 7 +-- mm/khugepaged.c | 3 --- mm/memory-failure.c | 3 --- mm/memory_hotplug.c | 4 mm/mempolicy.c

[PATCH v4 0/4] Introduce MADV_COLD and MADV_PAGEOUT

2019-07-10 Thread Minchan Kim
rg/lkml/20190610111252.239156-1-minc...@kernel.org * v1 - http://lore.kernel.org/lkml/20190603053655.127730-1-minc...@kernel.org Minchan Kim (4): mm: introduce MADV_COLD mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM mm: account nr_isolated_xxx in [isolate|putback]_lru_page mm: in

[PATCH v4 1/4] mm: introduce MADV_COLD

2019-07-10 Thread Minchan Kim
e_youn in deactivate_page - joelaf * Revise the description - surenb * Renaming from MADV_WARM to MADV_COOL - surenb Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- include/linux/swap.h | 1 + include/uapi/asm-generic/mman-common.h | 1 + mm/inte

[PATCH v4 2/4] mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM

2019-07-10 Thread Minchan Kim
for next patch. * RFCv1 * use ignore_referecnes as parameter name - hannes Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minchan Kim --- mm/vmscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a0301edd8d03

Re: [PATCH v3 4/5] mm: introduce MADV_PAGEOUT

2019-07-10 Thread Minchan Kim
On Wed, Jul 10, 2019 at 09:47:19PM +0200, Michal Hocko wrote: > On Wed 10-07-19 20:53:56, Minchan Kim wrote: > > On Wed, Jul 10, 2019 at 01:16:22PM +0200, Michal Hocko wrote: > > > On Wed 10-07-19 19:48:09, Minchan Kim wrote: > > > > On Tue, Jul 09, 2019 at 11:55:

Re: [PATCH v3 4/5] mm: introduce MADV_PAGEOUT

2019-07-10 Thread Minchan Kim
On Wed, Jul 10, 2019 at 01:16:22PM +0200, Michal Hocko wrote: > On Wed 10-07-19 19:48:09, Minchan Kim wrote: > > On Tue, Jul 09, 2019 at 11:55:19AM +0200, Michal Hocko wrote: > [...] > > > I am still not convinced about the SWAP_CLUSTER_MAX batching and the > > > u

Re: [PATCH v3 5/5] mm: factor out pmd young/dirty bit handling and THP split

2019-07-10 Thread Minchan Kim
On Tue, Jul 09, 2019 at 04:10:19PM +0200, Michal Hocko wrote: > On Thu 27-06-19 20:54:05, Minchan Kim wrote: > > Now, there are common part among MADV_COLD|PAGEOUT|FREE to reset > > access/dirty bit resetting or split the THP page to handle part > > of subpages in the THP pa

Re: [PATCH v3 4/5] mm: introduce MADV_PAGEOUT

2019-07-10 Thread Minchan Kim
On Tue, Jul 09, 2019 at 11:55:19AM +0200, Michal Hocko wrote: > On Thu 27-06-19 20:54:04, Minchan Kim wrote: > > When a process expects no accesses to a certain memory range > > for a long time, it could hint kernel that the pages can be > > reclaimed instantly but dat

Re: [PATCH RESEND] mm: show number of vmalloc pages in /proc/meminfo

2019-07-09 Thread Minchan Kim
m: get rid of 'vmalloc_info' from > /proc/meminfo")), let's reuse it for showing the actual > physical memory consumption of vmalloc(). > > Signed-off-by: Roman Gushchin > Acked-by: Johannes Weiner > Acked-by: Vlastimil Babka Acked-by: Minchan Kim How it's going on? Android

Re: [PATCH v3 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-07-01 Thread Minchan Kim
Hi Folks, Do you guys have comments? I think it would be long enough to be pending. If there is no further comments, I want to ask to merge. Thanks. On Thu, Jun 27, 2019 at 08:54:00PM +0900, Minchan Kim wrote: > This patch is part of previous series: > https://lore.kernel.or

Re: [PATCH v3 1/5] mm: introduce MADV_COLD

2019-07-01 Thread Minchan Kim
On Fri, Jun 28, 2019 at 08:56:18AM +0900, Minchan Kim wrote: > On Thu, Jun 27, 2019 at 04:53:02PM +0200, Michal Hocko wrote: > > On Thu 27-06-19 07:36:50, Dave Hansen wrote: > > [...] > > > For MADV_COLD, if we defined it like this, I think we could use it for > > >

Re: [PATCH v2] mm: vmscan: fix not scanning anonymous pages when detecting file refaults

2019-06-28 Thread Minchan Kim
On Fri, Jun 28, 2019 at 10:32:01AM -0400, Johannes Weiner wrote: > On Fri, Jun 28, 2019 at 07:16:27PM +0800, Kuo-Hsin Yang wrote: > > When file refaults are detected and there are many inactive file pages, > > the system never reclaim anonymous pages, the file pages are dropped > > aggressively

Re: [PATCH] mm: vmscan: fix not scanning anonymous pages when detecting file refaults

2019-06-28 Thread Minchan Kim
On Fri, Jun 28, 2019 at 10:22:52AM -0400, Johannes Weiner wrote: > Hi Minchan, > > On Fri, Jun 28, 2019 at 03:51:38PM +0900, Minchan Kim wrote: > > On Thu, Jun 27, 2019 at 02:41:23PM -0400, Johannes Weiner wrote: > > > On Wed, Jun 19, 2019 at 04:08:35PM +0800, Kuo-Hsin Y

Re: [PATCH] mm: vmscan: fix not scanning anonymous pages when detecting file refaults

2019-06-28 Thread Minchan Kim
Hi Kuo-Hsin, On Wed, Jun 19, 2019 at 04:08:35PM +0800, Kuo-Hsin Yang wrote: > When file refaults are detected and there are many inactive file pages, > the system never reclaim anonymous pages, the file pages are dropped > aggressively when there are still a lot of cold anonymous pages and >

Re: [PATCH] mm: vmscan: fix not scanning anonymous pages when detecting file refaults

2019-06-28 Thread Minchan Kim
Hi Johannes, On Thu, Jun 27, 2019 at 02:41:23PM -0400, Johannes Weiner wrote: > On Wed, Jun 19, 2019 at 04:08:35PM +0800, Kuo-Hsin Yang wrote: > > When file refaults are detected and there are many inactive file pages, > > the system never reclaim anonymous pages, the file pages are dropped > >

Re: [PATCH v3 1/5] mm: introduce MADV_COLD

2019-06-27 Thread Minchan Kim
On Thu, Jun 27, 2019 at 04:53:02PM +0200, Michal Hocko wrote: > On Thu 27-06-19 07:36:50, Dave Hansen wrote: > [...] > > For MADV_COLD, if we defined it like this, I think we could use it for > > both purposes (demotion and LRU movement): > > > > Pages in the specified regions will be treated

Re: [PATCH v3 1/5] mm: introduce MADV_COLD

2019-06-27 Thread Minchan Kim
On Thu, Jun 27, 2019 at 06:13:36AM -0700, Dave Hansen wrote: > On 6/27/19 4:54 AM, Minchan Kim wrote: > > This patch introduces the new MADV_COLD hint to madvise(2) syscall. > > MADV_COLD can be used by a process to mark a memory range as not expected > > to be used in the

Re: [PATCH v3 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-06-27 Thread Minchan Kim
On Thu, Jun 27, 2019 at 09:06:01PM +0300, Kirill A. Shutemov wrote: > On Thu, Jun 27, 2019 at 08:54:00PM +0900, Minchan Kim wrote: > > - Problem > > > > Naturally, cached apps were dominant consumers of memory on the system. > > However, they were not significant co

[PATCH v3 2/5] mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLAIM

2019-06-27 Thread Minchan Kim
for next patch. * RFCv1 * use ignore_referecnes as parameter name - hannes Acked-by: Michal Hocko Acked-by: Johannes Weiner Signed-off-by: Minchan Kim --- mm/vmscan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 9e3292ee5c7c

[PATCH v3 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-06-27 Thread Minchan Kim
should be reclaimed immediately; MADV_COLD is similar to MADV_FREE in a way that it hints the kernel that memory region is not currently needed and should be reclaimed when memory pressure rises. Minchan Kim (5): mm: introduce MADV_COLD mm: change PAGEREF_RECLAIM_CLEAN with PAGE_REFRECLA

[PATCH v3 5/5] mm: factor out pmd young/dirty bit handling and THP split

2019-06-27 Thread Minchan Kim
Now, there are common part among MADV_COLD|PAGEOUT|FREE to reset access/dirty bit resetting or split the THP page to handle part of subpages in the THP page. This patch factor out the common part. Signed-off-by: Minchan Kim --- include/linux/huge_mm.h | 3 - mm/huge_memory.c| 74

[PATCH v3 3/5] mm: account nr_isolated_xxx in [isolate|putback]_lru_page

2019-06-27 Thread Minchan Kim
://lkml.kernel.org/r/20190531165927.ga20...@cmpxchg.org Suggested-by: Johannes Weiner Signed-off-by: Minchan Kim --- mm/compaction.c | 2 -- mm/gup.c| 7 +-- mm/khugepaged.c | 3 --- mm/memory-failure.c | 3 --- mm/memory_hotplug.c | 4 mm/mempolicy.c | 6 +- mm

[PATCH v3 4/5] mm: introduce MADV_PAGEOUT

2019-06-27 Thread Minchan Kim
factoring out isolate logic - hannes * RFCv1 * rename from MADV_COLD to MADV_PAGEOUT - hannes * bail out if process is being killed - Hillf * fix reclaim_pages bugs - Hillf Signed-off-by: Minchan Kim --- include/linux/swap.h | 1 + include/uapi/asm-generic/mman-common.h | 1

[PATCH v3 1/5] mm: introduce MADV_COLD

2019-06-27 Thread Minchan Kim
RFCv1 * renaming from MADV_COOL to MADV_COLD - hannes * internal review * use clear_page_youn in deactivate_page - joelaf * Revise the description - surenb * Renaming from MADV_WARM to MADV_COOL - surenb Signed-off-by: Minchan Kim --- include/linux/swap.h | 1 + includ

Re: [PATCH v2 4/5] mm: introduce MADV_PAGEOUT

2019-06-20 Thread Minchan Kim
On Thu, Jun 20, 2019 at 11:22:09AM +0200, Michal Hocko wrote: > On Thu 20-06-19 17:40:40, Minchan Kim wrote: > > > > > Pushing out a shared page cache > > > > > is possible even now but this interface gives a much easier tool to > > > > > evict shar

Re: [PATCH v2 1/5] mm: introduce MADV_COLD

2019-06-20 Thread Minchan Kim
On Thu, Jun 20, 2019 at 09:08:54AM +0200, Michal Hocko wrote: > On Thu 20-06-19 09:06:51, Minchan Kim wrote: > > On Wed, Jun 19, 2019 at 02:56:12PM +0200, Michal Hocko wrote: > [...] > > > Why cannot we reuse a large part of that code and differ essentially on > >

Re: [PATCH v2 4/5] mm: introduce MADV_PAGEOUT

2019-06-20 Thread Minchan Kim
On Thu, Jun 20, 2019 at 09:04:44AM +0200, Michal Hocko wrote: > On Thu 20-06-19 13:16:20, Minchan Kim wrote: > > On Wed, Jun 19, 2019 at 03:24:50PM +0200, Michal Hocko wrote: > > > On Mon 10-06-19 20:12:51, Minchan Kim wrote: > > > [...] > > > > +static i

Re: [PATCH v1 1/4] mm: introduce MADV_COLD

2019-06-19 Thread Minchan Kim
On Wed, Jun 19, 2019 at 01:13:40PM -0400, Joel Fernandes wrote: < snip > Ccing Vladimir > > > > > > +static int madvise_cold_pte_range(pmd_t *pmd, unsigned long addr, > > > > > > + unsigned long end, struct mm_walk *walk) > > > > > > +{ > > > > > > + pte_t *orig_pte,

Re: [PATCH v2 4/5] mm: introduce MADV_PAGEOUT

2019-06-19 Thread Minchan Kim
On Wed, Jun 19, 2019 at 03:24:50PM +0200, Michal Hocko wrote: > On Mon 10-06-19 20:12:51, Minchan Kim wrote: > [...] > > +static int madvise_pageout_pte_range(pmd_t *pmd, unsigned long addr, > > + unsigned long end, struct mm_walk *walk) > > Again

Re: [PATCH v2 1/5] mm: introduce MADV_COLD

2019-06-19 Thread Minchan Kim
On Wed, Jun 19, 2019 at 02:56:12PM +0200, Michal Hocko wrote: > On Mon 10-06-19 20:12:48, Minchan Kim wrote: > > When a process expects no accesses to a certain memory range, it could > > give a hint to kernel that the pages can be reclaimed when memory pressure > > ha

Re: [PATCH v2 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-06-19 Thread Minchan Kim
On Wed, Jun 19, 2019 at 02:27:50PM +0200, Michal Hocko wrote: > On Mon 10-06-19 20:12:47, Minchan Kim wrote: > > This patch is part of previous series: > > https://lore.kernel.org/lkml/20190531064313.193437-1-minc...@kernel.org/T/#u > > Originally, it was created for ext

Re: [PATCH v1 1/4] mm: introduce MADV_COLD

2019-06-13 Thread Minchan Kim
On Wed, Jun 12, 2019 at 01:21:04PM -0400, Joel Fernandes wrote: > On Mon, Jun 10, 2019 at 07:09:04PM +0900, Minchan Kim wrote: > > Hi Joel, > > > > On Tue, Jun 04, 2019 at 04:38:41PM -0400, Joel Fernandes wrote: > > > On Mon, Jun 03, 2019 at 02:36:52PM +0900, M

Re: [PATCH v2 0/5] Introduce MADV_COLD and MADV_PAGEOUT

2019-06-13 Thread Minchan Kim
On Mon, Jun 10, 2019 at 11:03:00AM -0700, Dave Hansen wrote: > I'd really love to see the manpages for these new flags. The devil is > in the details of our promises to userspace. I'm waiting comments from reviewers since I have fixed what they point out from the previous version. I will add

Re: [PATCH] mm: fix trying to reclaim unevicable LRU page

2019-06-10 Thread Minchan Kim
On Mon, Jun 10, 2019 at 12:39:46PM +0200, Michal Hocko wrote: > On Mon 10-06-19 18:42:22, Minchan Kim wrote: > > On Tue, Jun 04, 2019 at 02:28:06PM +0200, Michal Hocko wrote: > > > On Thu 30-05-19 11:42:29, Minchan Kim wrote: > > > > On Tue, May 28, 2019 at 05:14:

[PATCH v2 5/5] mm: factor out pmd young/dirty bit handling and THP split

2019-06-10 Thread Minchan Kim
Now, there are common part among MADV_COLD|PAGEOUT|FREE to reset access/dirty bit resetting or split the THP page to handle part of subpages in the THP page. This patch factor out the common part. Cc: "Kirill A. Shutemov" Cc: Christopher Lameter Signed-off-by: Minchan Kim --- inc

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