Re: [PATCH v2] mm: add alloc_contig_migrate_range allocation statistics

2024-02-28 Thread Minchan Kim
; > This patch adds the trace event to collect the allocation statistics. > In the field, it was quite useful to understand CMA allocation > latency. > > Signed-off-by: Richard Chang Acked-by: Minchan Kim

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-04-06 Thread Minchan Kim
On Tue, Apr 06, 2021 at 06:23:46PM -0700, Minchan Kim wrote: > On Tue, Apr 06, 2021 at 12:29:09AM +, Luis Chamberlain wrote: > > On Mon, Apr 05, 2021 at 12:58:05PM -0700, Minchan Kim wrote: > > > On Mon, Apr 05, 2021 at 07:00:23PM +, Luis Chamberlain wrote: > >

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-04-06 Thread Minchan Kim
On Tue, Apr 06, 2021 at 12:29:09AM +, Luis Chamberlain wrote: > On Mon, Apr 05, 2021 at 12:58:05PM -0700, Minchan Kim wrote: > > On Mon, Apr 05, 2021 at 07:00:23PM +, Luis Chamberlain wrote: > > > On Mon, Apr 05, 2021 at 10:07:24AM -0700, Minchan Kim wrote: > >

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-04-05 Thread Minchan Kim
On Mon, Apr 05, 2021 at 07:00:23PM +, Luis Chamberlain wrote: > On Mon, Apr 05, 2021 at 10:07:24AM -0700, Minchan Kim wrote: > > On Thu, Apr 01, 2021 at 11:59:25PM +, Luis Chamberlain wrote: > > > And come to think of it the last patch I had sent with a new > > >

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-04-05 Thread Minchan Kim
On Thu, Apr 01, 2021 at 11:59:25PM +, Luis Chamberlain wrote: > On Mon, Mar 22, 2021 at 03:12:01PM -0700, Minchan Kim wrote: > > On Mon, Mar 22, 2021 at 08:41:56PM +, Luis Chamberlain wrote: > > > > > > I would not call it *every* syfs knob as not

[PATCH] mm: use proper type for cma_[alloc|release]

2021-03-31 Thread Minchan Kim
: fix incorrect type conversion for size during dma allocation Link: https://lore.kernel.org/linux-mm/20210324043434.gp1719...@casper.infradead.org/ Cc: Matthew Wilcox Cc: David Hildenbrand Signed-off-by: Minchan Kim --- include/linux/cma.h| 4 ++-- include/linux/gfp.h| 2

[PATCH] mm: cma: add the CMA instance name to cma trace events

2021-03-30 Thread Minchan Kim
-georgi.dja...@linaro.org Cc: Liam Mark Cc: Georgi Djakov Signed-off-by: Minchan Kim --- include/trace/events/cma.h | 28 +--- mm/cma.c | 7 --- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/include/trace/events/cma.h b/include/trace

Re: [PATCH] mm: change size_t to unsigned int for cma_alloc

2021-03-30 Thread Minchan Kim
On Tue, Mar 30, 2021 at 09:58:37AM +0200, David Hildenbrand wrote: > On 29.03.21 22:12, Minchan Kim wrote: > > On Mon, Mar 29, 2021 at 07:44:31PM +0100, Matthew Wilcox wrote: > > > On Mon, Mar 29, 2021 at 11:25:53AM -0700, Minchan Kim wrote: > > > > size_t in cma_all

Re: [PATCH] mm: change size_t to unsigned int for cma_alloc

2021-03-29 Thread Minchan Kim
On Mon, Mar 29, 2021 at 07:44:31PM +0100, Matthew Wilcox wrote: > On Mon, Mar 29, 2021 at 11:25:53AM -0700, Minchan Kim wrote: > > size_t in cma_alloc is confusing since it makes people think > > it's byte count, not pages. Fix it. > > i think it ha

[PATCH] mm: change size_t to unsigned int for cma_alloc

2021-03-29 Thread Minchan Kim
size_t in cma_alloc is confusing since it makes people think it's byte count, not pages. Fix it. Link: https://lore.kernel.org/linux-mm/20210324043434.gp1719...@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Minchan Kim --- include/linux/cma.h | 2 +- mm/cma.c| 8

Re: [PATCH] mm: cma: Add the CMA instance name to the cma_alloc_start trace event

2021-03-26 Thread Minchan Kim
On Fri, Mar 26, 2021 at 05:54:14PM +0200, Georgi Djakov wrote: > During CMA allocation, print also the name to identify the CMA instance. > > Suggested-by: Minchan Kim > Signed-off-by: Georgi Djakov Acked-by: Minchan Kim I guess Andrew will fold this one into original patch. Thanks, Georgi!

Re: [PATCH v8] mm: cma: support sysfs

2021-03-26 Thread Minchan Kim
On Fri, Mar 26, 2021 at 02:59:30PM +0100, Anders Roxell wrote: > On Thu, 25 Mar 2021 at 00:09, Minchan Kim wrote: > > > > Since CMA is getting used more widely, it's more important to > > keep monitoring CMA statistics for system health since it's > > directly

Re: [PATCH 1/8] mm: cma: introduce cma_release_nowait()

2021-03-25 Thread Minchan Kim
On Thu, Mar 25, 2021 at 06:15:11PM +0100, David Hildenbrand wrote: > On 25.03.21 17:56, Mike Kravetz wrote: > > On 3/25/21 3:22 AM, Michal Hocko wrote: > > > On Thu 25-03-21 10:56:38, David Hildenbrand wrote: > > > > On 25.03.21 01:28, Mike Kravetz wrote: > > > > > From: Roman Gushchin > > > > >

[PATCH v8] mm: cma: support sysfs

2021-03-24 Thread Minchan Kim
Reviewed-by: John Hubbard Link: https://lore.kernel.org/linux-mm/20210316100433.17665-1-colin.k...@canonical.com/ Addresses-Coverity: ("Dereference after null check") Signed-off-by: Colin Ian King Signed-off-by: Minchan Kim --- Andrew, you could apply this patch after revering these pa

Re: [PATCH v7] mm: cma: support sysfs

2021-03-24 Thread Minchan Kim
On Thu, Mar 25, 2021 at 12:31:51AM +0300, Dmitry Osipenko wrote: > 24.03.2021 23:55, Minchan Kim пишет: > > Since CMA is getting used more widely, it's more important to > > keep monitoring CMA statistics for system health since it's > > directly related to user experience

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 11:02:47PM +0300, Dmitry Osipenko wrote: > 24.03.2021 22:57, Minchan Kim пишет: > > On Wed, Mar 24, 2021 at 10:49:58PM +0300, Dmitry Osipenko wrote: > >> 24.03.2021 22:43, Dmitry Osipenko пишет: > >>> 24.03.2021 22:20, Minchan Kim пи

[PATCH v7] mm: cma: support sysfs

2021-03-24 Thread Minchan Kim
Suggested-by: John Hubbard Suggested-by: Matthew Wilcox Reviewed-by: Greg Kroah-Hartman Reviewed-by: John Hubbard Addresses-Coverity: ("Dereference after null check") Signed-off-by: Colin Ian King Signed-off-by: Minchan Kim --- Andrew, you could apply this patch after revering these pa

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 10:49:58PM +0300, Dmitry Osipenko wrote: > 24.03.2021 22:43, Dmitry Osipenko пишет: > > 24.03.2021 22:20, Minchan Kim пишет: > >> static int __init cma_sysfs_init(void) > >> { > >> - int i = 0; > >> + struct kobject *cma_ko

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 08:53:26PM +0100, David Hildenbrand wrote: > On 24.03.21 20:45, John Hubbard wrote: > > On 3/24/21 12:20 PM, Minchan Kim wrote: > > > struct cma_stat's lifespan for cma_sysfs is different with > > > struct cma because kobject for sysfs requires

Re: [PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 10:43:49PM +0300, Dmitry Osipenko wrote: > 24.03.2021 22:20, Minchan Kim пишет: > > static int __init cma_sysfs_init(void) > > { > > - int i = 0; > > + struct kobject *cma_kobj_root; > > + struct cma_kobject *cma_kobj; > >

Re: [PATCH] mm: cma: add trace events for CMA alloc perf testing

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 06:07:40PM +0200, Georgi Djakov wrote: > From: Liam Mark > > Add cma and migrate trace events to enable CMA allocation > performance to be measured via ftrace. > > Signed-off-by: Liam Mark > Signed-off-by: Georgi Djakov > --- > include/trace/events/cma.h | 39

[PATCH] mm: cma: fix corruption cma_sysfs_alloc_pages_count

2021-03-24 Thread Minchan Kim
Osipenko Tested-by: Dmitry Osipenko Suggested-by: Dmitry Osipenko Suggested-by: John Hubbard Suggested-by: Matthew Wilcox Signed-off-by: Minchan Kim --- I belive it's worth to have separate patch rather than replacing original patch. It will also help to merge without conflict since we already

Re: [PATCH v6] mm: cma: support sysfs

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 03:37:02PM +0300, Dmitry Osipenko wrote: > 24.03.2021 08:44, Minchan Kim пишет: > > On Tue, Mar 23, 2021 at 09:47:27PM -0700, John Hubbard wrote: > >> On 3/23/21 8:27 PM, Minchan Kim wrote: > >> ... > >>>&g

Re: [PATCH v6] mm: cma: support sysfs

2021-03-24 Thread Minchan Kim
On Wed, Mar 24, 2021 at 03:33:07PM +0300, Dmitry Osipenko wrote: > 24.03.2021 04:05, Minchan Kim пишет: > > +static struct kobject *cma_kobj_root; > > This should be a local variable. Sure. > > > +static struct kobj_type cma_ktype = { > > + .release = cma_ko

Re: [PATCH v6] mm: cma: support sysfs

2021-03-24 Thread Minchan Kim
On Tue, Mar 23, 2021 at 11:26:08PM -0700, John Hubbard wrote: > On 3/23/21 10:44 PM, Minchan Kim wrote: > > On Tue, Mar 23, 2021 at 09:47:27PM -0700, John Hubbard wrote: > > > On 3/23/21 8:27 PM, Minchan Kim wrote: > > > ... > > > > >

Re: [PATCH v5] mm: cma: support sysfs

2021-03-23 Thread Minchan Kim
On Wed, Mar 24, 2021 at 04:34:34AM +, Matthew Wilcox wrote: > On Tue, Mar 23, 2021 at 08:31:31PM -0700, Minchan Kim wrote: > > On Wed, Mar 24, 2021 at 03:02:24AM +, Matthew Wilcox wrote: > > > On Tue, Mar 23, 2021 at 12:50:50PM -0700, Minchan Kim wrote: > > > >

Re: [PATCH v6] mm: cma: support sysfs

2021-03-23 Thread Minchan Kim
On Tue, Mar 23, 2021 at 09:47:27PM -0700, John Hubbard wrote: > On 3/23/21 8:27 PM, Minchan Kim wrote: > ... > > > > +static int __init cma_sysfs_init(void) > > > > +{ > > > > + unsigned int i; > > > > + > > >

Re: [PATCH v5] mm: cma: support sysfs

2021-03-23 Thread Minchan Kim
On Wed, Mar 24, 2021 at 03:02:24AM +, Matthew Wilcox wrote: > On Tue, Mar 23, 2021 at 12:50:50PM -0700, Minchan Kim wrote: > > + /* the number of CMA page successful allocations */ > > + atomic64_t nr_pages_succeeded; > > > +void cma_sysfs_alloc_pages_count(struc

Re: [PATCH v6] mm: cma: support sysfs

2021-03-23 Thread Minchan Kim
On Tue, Mar 23, 2021 at 07:34:12PM -0700, John Hubbard wrote: > On 3/23/21 6:05 PM, Minchan Kim wrote: > ...> diff --git a/mm/cma_sysfs.c b/mm/cma_sysfs.c > > new file mode 100644 > > index ..c3791a032dc5 > > --- /dev/null > > +++ b/mm/cma_sysfs.c &

[PATCH v6] mm: cma: support sysfs

2021-03-23 Thread Minchan Kim
Signed-off-by: Minchan Kim --- >From v5 - >https://lore.kernel.org/linux-mm/20210323195050.2577017-1-minc...@kernel.org/ * refactoring and fix typo - digetx@ >From v4 - >https://lore.kernel.org/linux-mm/20210309062333.3216138-1-minc...@kernel.org/ * fix corruption - digetx@ >Fr

Re: [PATCH v5] mm: cma: support sysfs

2021-03-23 Thread Minchan Kim
On Wed, Mar 24, 2021 at 12:44:06AM +0300, Dmitry Osipenko wrote: > 23.03.2021 22:50, Minchan Kim пишет: > > +#ifdef CONFIG_CMA_SYSFS > > +void cma_sysfs_alloc_pages_count(struct cma *cma, size_t count); > > +void cma_sysfs_fail_pages_count(struct cma *cma, size_t count);

[PATCH v5] mm: cma: support sysfs

2021-03-23 Thread Minchan Kim
Signed-off-by: Minchan Kim --- >From v4 - >https://lore.kernel.org/linux-mm/20210309062333.3216138-1-minc...@kernel.org/ * fix corruption - digetx@ >From v3 - >https://lore.kernel.org/linux-mm/20210303205053.2906924-1-minc...@kernel.org/ * fix ZERO_OR_NULL_PTR - kernel test robot * r

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-03-22 Thread Minchan Kim
On Mon, Mar 22, 2021 at 08:41:56PM +, Luis Chamberlain wrote: > On Mon, Mar 22, 2021 at 09:37:17AM -0700, Minchan Kim wrote: > > On Fri, Mar 19, 2021 at 07:09:24PM +, Luis Chamberlain wrote: > > > Indeed one issue is a consequence of the other but a bit better > >

Re: [PATCH v4 3/3] mm: fs: Invalidate BH LRU during page migration

2021-03-22 Thread Minchan Kim
On Sat, Mar 20, 2021 at 03:51:40PM -0700, Chris Goldsworthy wrote: > On 2021-03-20 12:54, Matthew Wilcox wrote: > > On Sat, Mar 20, 2021 at 10:20:09AM -0700, Minchan Kim wrote: > > > > > Tested-by: Oliver Sang > > > > > Reported-by: kernel test robot >

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-03-22 Thread Minchan Kim
On Fri, Mar 19, 2021 at 07:09:24PM +, Luis Chamberlain wrote: > On Fri, Mar 12, 2021 at 11:28:21AM -0800, Minchan Kim wrote: > > On Fri, Mar 12, 2021 at 06:32:38PM +, Luis Chamberlain wrote: > > > On Thu, Mar 11, 2021 at 06:14:40PM -0800, Minchan Kim wrote: > >

Re: [PATCH v4 3/3] mm: fs: Invalidate BH LRU during page migration

2021-03-20 Thread Minchan Kim
On Sat, Mar 20, 2021 at 09:32:49AM -0700, Andrew Morton wrote: > On Fri, 19 Mar 2021 10:51:27 -0700 Minchan Kim wrote: > > > Pages containing buffer_heads that are in one of the per-CPU > > buffer_head LRU caches will be pinned and thus cannot be migrated. > > This can

Re: [PATCH v4] mm: cma: support sysfs

2021-03-19 Thread Minchan Kim
On Fri, Mar 19, 2021 at 09:48:11PM +0300, Dmitry Osipenko wrote: > 19.03.2021 21:21, Minchan Kim пишет: > > On Fri, Mar 19, 2021 at 08:56:06PM +0300, Dmitry Osipenko wrote: > >> 19.03.2021 19:30, Minchan Kim пишет: > >>> +static void cma_kobj_release(struct kobject

Re: [PATCH v4] mm: cma: support sysfs

2021-03-19 Thread Minchan Kim
On Fri, Mar 19, 2021 at 08:56:06PM +0300, Dmitry Osipenko wrote: > 19.03.2021 19:30, Minchan Kim пишет: > > +static void cma_kobj_release(struct kobject *kobj) > > +{ > > + struct cma_kobject *cma_kobj = container_of(kobj, struct cma_kobject, > > kobj); &

Re: [PATCH v4] mm: cma: support sysfs

2021-03-19 Thread Minchan Kim
On Fri, Mar 19, 2021 at 08:29:29PM +0300, Dmitry Osipenko wrote: > 19.03.2021 19:30, Minchan Kim пишет: > > On Fri, Mar 19, 2021 at 07:24:05PM +0300, Dmitry Osipenko wrote: > >> 19.03.2021 18:50, Greg Kroah-Hartman пишет: > >>>> Then initialization order

[PATCH v4 1/3] mm: disable LRU pagevec during the migration temporarily

2021-03-19 Thread Minchan Kim
upt others running during the operation. With the new interface the operation happens only once. This is also in line with pcp allocator cache which are disabled for the offlining as well. Reviewed-by: Chris Goldsworthy Acked-by: Michal Hocko Signed-off-by: Minchan Kim --- include/linux/migrate.

[PATCH v4 3/3] mm: fs: Invalidate BH LRU during page migration

2021-03-19 Thread Minchan Kim
being cached in the LRU caches, until migration has finished. Tested-by: Oliver Sang Reported-by: kernel test robot Signed-off-by: Chris Goldsworthy Signed-off-by: Minchan Kim --- fs/buffer.c | 36 ++-- include/linux/buffer_head.h | 4 mm

[PATCH v4 2/3] mm: replace migrate_[prep|finish] with lru_cache_[disable|enable]

2021-03-19 Thread Minchan Kim
into lru_add_drain to avoid CPU schedule cost with involving many other CPUs to keep keep old behavior. Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Signed-off-by: Minchan Kim --- include/linux/migrate.h | 7 --- mm/compaction.c | 3 ++- mm/mempolicy.c | 8

Re: [mm] 8fd8d23ab1: WARNING:at_fs/buffer.c:#__brelse

2021-03-19 Thread Minchan Kim
On Fri, Mar 19, 2021 at 10:05:28PM +0800, Oliver Sang wrote: > Hi Minchan, > > On Wed, Mar 17, 2021 at 09:29:38AM -0700, Minchan Kim wrote: > > On Wed, Mar 17, 2021 at 10:37:57AM +0800, kernel test robot wrote: > > > > > > > > > Greeting, > > >

Re: [PATCH v4] mm: cma: support sysfs

2021-03-19 Thread Minchan Kim
d > just correct this patch and re-push it to -next. This is ateempt to address it. Unless any objection, let me send it to akpm. >From 29a9fb4f300b754ebf55e6182ba84127658ef504 Mon Sep 17 00:00:00 2001 From: Minchan Kim Date: Fri, 22 Jan 2021 12:31:56 -0800 Subject: [PATCH] mm: cma: support sysfs Si

Re: [PATCH v3 2/3] mm: disable LRU pagevec during the migration temporarily

2021-03-17 Thread Minchan Kim
On Wed, Mar 17, 2021 at 05:13:16PM -0700, Andrew Morton wrote: > On Wed, 10 Mar 2021 08:14:28 -0800 Minchan Kim wrote: > > > LRU pagevec holds refcount of pages until the pagevec are drained. > > It could prevent migration since the refcount of the page is greater >

Re: [mm] 8fd8d23ab1: WARNING:at_fs/buffer.c:#__brelse

2021-03-17 Thread Minchan Kim
e migration") > url: > https://github.com/0day-ci/linux/commits/Minchan-Kim/mm-replace-migrate_prep-with-lru_add_drain_all/20210311-001714 > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git > 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32 > > in testcase: bl

Re: [PATCH v3 3/3] mm: fs: Invalidate BH LRU during page migration

2021-03-16 Thread Minchan Kim
On Fri, Mar 12, 2021 at 09:17:23AM -0800, Minchan Kim wrote: > On Fri, Mar 12, 2021 at 10:33:48AM +0100, David Hildenbrand wrote: > > On 12.03.21 10:03, David Hildenbrand wrote: > > > On 10.03.21 17:14, Minchan Kim wrote: > > > > ffer_head LRU caches will be pinn

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

2021-03-16 Thread Minchan Kim
On Mon, Mar 15, 2021 at 04:35:22PM +1100, Stephen Rothwell wrote: > Hi all, > > After merging the akpm-current tree, today's linux-next build (htmldocs) > produced this warning: > > Documentation/ABI/testing/sysfs-kernel-mm-cma:2: WARNING: Inline interpreted > text or phrase reference

Re: [PATCH] mm: cma: Fix potential null dereference on pointer cma

2021-03-16 Thread Minchan Kim
nces cma, hence there is a > potential null pointer deference issue. Fix this by only calling > cma_sysfs_fail_pages_count if cma is not null. > > Addresses-Coverity: ("Dereference after null check") > Fixes: dc4764f7e9ac ("mm: cma: support sysfs") > Signed-off-by: Colin Ian King Acked-by: Minchan Kim

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-03-12 Thread Minchan Kim
On Fri, Mar 12, 2021 at 06:32:38PM +, Luis Chamberlain wrote: > On Thu, Mar 11, 2021 at 06:14:40PM -0800, Minchan Kim wrote: > > On Wed, Mar 10, 2021 at 09:21:28PM +, Luis Chamberlain wrote: > > > On Mon, Mar 08, 2021 at 06:55:30PM -0800, Minchan Kim wrote: >

[PATCH 1/2] zram: fix return value on writeback_store

2021-03-12 Thread Minchan Kim
it will succeed. Cc: Sergey Senozhatsky Cc: Colin Ian King Cc: sta...@vger.kernel.org Fixes: 3b82a051c101("drivers/block/zram/zram_drv.c: fix error return codes not being returned in writeback_store") Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 11 --- 1 file

[PATCH 2/2] zram: fix broken page writeback

2021-03-12 Thread Minchan Kim
g Reported-by: Amos Bianchi Fixes: 0d8359620d9b("zram: support page writeback") Signed-off-by: Minchan Kim --- drivers/block/zram/zram_drv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 63bbef

Re: [PATCH v3 3/3] mm: fs: Invalidate BH LRU during page migration

2021-03-12 Thread Minchan Kim
On Fri, Mar 12, 2021 at 10:33:48AM +0100, David Hildenbrand wrote: > On 12.03.21 10:03, David Hildenbrand wrote: > > On 10.03.21 17:14, Minchan Kim wrote: > > > ffer_head LRU caches will be pinned and thus cannot be migrated. > > > This can prevent CMA allocations from

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-03-11 Thread Minchan Kim
On Wed, Mar 10, 2021 at 09:21:28PM +, Luis Chamberlain wrote: > On Mon, Mar 08, 2021 at 06:55:30PM -0800, Minchan Kim wrote: > > If I understand correctly, bugs you found were related to module > > unloading race while the zram are still working. > > No, that is a simpl

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-03-11 Thread Minchan Kim
On Wed, Mar 10, 2021 at 01:11:15PM +, Luis Chamberlain wrote: > On Mon, Mar 08, 2021 at 06:55:30PM -0800, Minchan Kim wrote: > > On Sat, Mar 06, 2021 at 02:20:34AM +, Luis Chamberlain wrote: > > > The zram driver makes use of cpu hotplug multistate support, > >

[PATCH v5] mm: page_alloc: dump migrate-failed pages

2021-03-11 Thread Minchan Kim
the information here. See [1]. [1] https://lore.kernel.org/linux-mm/yeh4doxvyurl5...@google.com/ Reviewed-by: David Hildenbrand Signed-off-by: Minchan Kim --- * from v4 - https://lore.kernel.org/linux-mm/20210311183047.805891-1-minc...@kernel.org/ * better description - david * add revie

Re: [PATCH v4] mm: page_alloc: dump migrate-failed pages

2021-03-11 Thread Minchan Kim
On Thu, Mar 11, 2021 at 07:53:01PM +0100, David Hildenbrand wrote: > On 11.03.21 19:30, Minchan Kim wrote: > > Currently, debugging CMA allocation failures is quite limited. > > The most commong source of these failures seems to be page > > s/commong/common/ Oops. > >

Re: [PATCH] mm: cma: Use pr_err_ratelimited for CMA warning

2021-03-11 Thread Minchan Kim
ad to reduce the duplicate CMA warning. > > Signed-off-by: Baolin Wang Acked-by: Minchan Kim

[PATCH v4] mm: page_alloc: dump migrate-failed pages

2021-03-11 Thread Minchan Kim
There are bunch of places to use the inconsistent loglevel utility functions(e.g., just grep dump_page/strace_trace_print). It's unfortunate but here we are. It could be addressed different patchset. Signed-off-by: Minchan Kim --- * from v3 - https://lore.kernel.org/linux-mm/20210310180104.517886-1-minc.

Re: [PATCH v3] mm: page_alloc: dump migrate-failed pages

2021-03-11 Thread Minchan Kim
On Thu, Mar 11, 2021 at 05:40:35PM +0100, David Hildenbrand wrote: > On 10.03.21 19:01, Minchan Kim wrote: > > Currently, debugging CMA allocation failures is quite limited. > > The most commong source of these failures seems to be page > > migration which doesn't provide a

Re: [PATCH v3] mm: page_alloc: dump migrate-failed pages

2021-03-10 Thread Minchan Kim
On Wed, Mar 10, 2021 at 12:56:09PM -0800, Andrew Morton wrote: > On Wed, 10 Mar 2021 10:01:04 -0800 Minchan Kim wrote: > > > Currently, debugging CMA allocation failures is quite limited. > > The most commong source of these failures seems to be page > > migration w

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-10 Thread Minchan Kim
On Wed, Mar 10, 2021 at 09:06:48AM -0800, Minchan Kim wrote: > On Wed, Mar 10, 2021 at 05:46:56PM +0100, Michal Hocko wrote: > > On Wed 10-03-21 08:05:36, Minchan Kim wrote: > > > On Wed, Mar 10, 2021 at 02:07:05PM +0100, Michal Hocko wrote: > > [...] > > > > Th

[PATCH v3] mm: page_alloc: dump migrate-failed pages

2021-03-10 Thread Minchan Kim
There are bunch of places to use the inconsistent loglevel utility functions(e.g., just grep dump_page/strace_trace_print). It's unfortunate but here we are. It could be addressed different patchset. Signed-off-by: Minchan Kim --- * from v2 - https://lore.kernel.org/linux-mm/20210308202047.190380

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-10 Thread Minchan Kim
On Wed, Mar 10, 2021 at 05:46:56PM +0100, Michal Hocko wrote: > On Wed 10-03-21 08:05:36, Minchan Kim wrote: > > On Wed, Mar 10, 2021 at 02:07:05PM +0100, Michal Hocko wrote: > [...] > > > The is a lot of churn indeed. Have you considered adding $FOO_lglvl > > > vari

[PATCH v3 3/3] mm: fs: Invalidate BH LRU during page migration

2021-03-10 Thread Minchan Kim
being cached in the LRU caches, until migration has finished. Signed-off-by: Chris Goldsworthy Signed-off-by: Minchan Kim --- fs/buffer.c | 12 ++-- include/linux/buffer_head.h | 4 mm/swap.c | 5 - 3 files changed, 18 insertions(+), 3

[PATCH v3 1/3] mm: replace migrate_prep with lru_add_drain_all

2021-03-10 Thread Minchan Kim
schedule cost with involving many other CPUs to keep keep old behavior. Signed-off-by: Minchan Kim --- include/linux/migrate.h | 5 - mm/compaction.c | 3 ++- mm/mempolicy.c | 4 ++-- mm/migrate.c| 24 +--- mm/page_alloc.c | 2 +- mm

[PATCH v3 2/3] mm: disable LRU pagevec during the migration temporarily

2021-03-10 Thread Minchan Kim
upt others running during the operation. With the new interface the operation happens only once. This is also in line with pcp allocator cache which are disabled for the offlining as well. Signed-off-by: Minchan Kim --- include/linux/swap.h | 3 ++ mm/memory_hotplug.c | 3 +- mm/mempolicy.c |

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-10 Thread Minchan Kim
On Wed, Mar 10, 2021 at 02:07:05PM +0100, Michal Hocko wrote: > On Tue 09-03-21 23:42:46, Minchan Kim wrote: > > On Tue, Mar 09, 2021 at 08:15:41AM -0800, Minchan Kim wrote: > > > > < snip > > > > > > > [...] > > > > >

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-10 Thread Minchan Kim
On Wed, Mar 10, 2021 at 02:04:55PM +0100, Michal Hocko wrote: < snip > > > > Also are all those CONFIG_DYNAMIC_DEBUG* ifdefs necessary? Can we > > > simply enable DYNAMIC_DEBUG for page_alloc as I've suggested above? > > > > They are different usecases. > > > > With DYNAMIC_DEBUG_MODULE with

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-10 Thread Minchan Kim
On Wed, Mar 10, 2021 at 09:20:40AM +0100, David Hildenbrand wrote: > On 10.03.21 08:42, Minchan Kim wrote: > > On Tue, Mar 09, 2021 at 08:15:41AM -0800, Minchan Kim wrote: > > > > < snip > > > > > > > [...] > > > > >

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 08:15:41AM -0800, Minchan Kim wrote: < snip > > > [...] > > > +void dump_migrate_failure_pages(struct list_head *page_list) > > > +{ > > > + DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, > > > + "migrate f

Re: [PATCH 9/9] zsmalloc: remove the zsmalloc file system

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 04:53:48PM +0100, Christoph Hellwig wrote: > Just use the generic anon_inode file system. > > Signed-off-by: Christoph Hellwig Acked-by: Minchan Kim

Re: [PATCH 1/9] fs: rename alloc_anon_inode to alloc_anon_inode_sb

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 04:53:40PM +0100, Christoph Hellwig wrote: > Rename alloc_inode to free the name for a new variant that does not > need boilerplate to create a super_block first. > > Signed-off-by: Christoph Hellwig > --- > arch/powerpc/platforms/pseries/cmm.c | 2 +- >

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 05:32:08PM +0100, Michal Hocko wrote: > On Tue 09-03-21 08:15:41, Minchan Kim wrote: > > On Tue, Mar 09, 2021 at 10:32:51AM +0100, Michal Hocko wrote: > > > On Mon 08-03-21 12:20:47, Minchan Kim wrote: > > > > alloc_contig_range is usually us

Re: [PATCH v2 1/2] mm: disable LRU pagevec during the migration temporarily

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 05:31:09PM +0100, David Hildenbrand wrote: > > > > > Signed-off-by: Minchan Kim > > > > --- > > > > * from v1 - > > > > https://lore.kernel.org/lkml/20210302210949.2440120-1-minc...@kernel.org/ > > > >

Re: [PATCH v2 1/2] mm: disable LRU pagevec during the migration temporarily

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 12:03:08PM +0100, Michal Hocko wrote: > On Mon 08-03-21 21:16:27, Minchan Kim wrote: > > LRU pagevec holds refcount of pages until the pagevec are drained. > > It could prevent migration since the refcount of the page is greater > > than the expecti

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-09 Thread Minchan Kim
On Tue, Mar 09, 2021 at 10:32:51AM +0100, Michal Hocko wrote: > On Mon 08-03-21 12:20:47, Minchan Kim wrote: > > alloc_contig_range is usually used on cma area or movable zone. > > It's critical if the page migration fails on those areas so > > dump more debugging mes

[PATCH v4] mm: cma: support sysfs

2021-03-08 Thread Minchan Kim
/BLUETOOTH/alloc_pages_[success|fail] The cma_stat was intentionally allocated by dynamic allocation to harmonize with kobject lifetime management. https://lore.kernel.org/linux-mm/ycoamxqt6dzkc...@kroah.com/ Reviewed-by: Greg Kroah-Hartman Reviewed-by: John Hubbard Signed-off-by: Minchan Kim

[PATCH v2 2/2] mm: fs: Invalidate BH LRU during page migration

2021-03-08 Thread Minchan Kim
being cached in the LRU caches, until migration has finished. Signed-off-by: Chris Goldsworthy Signed-off-by: Minchan Kim --- fs/buffer.c | 12 ++-- include/linux/buffer_head.h | 3 +++ include/linux/swap.h| 1 + mm/swap.c | 5 - 4 files

[PATCH v2 1/2] mm: disable LRU pagevec during the migration temporarily

2021-03-08 Thread Minchan Kim
500 during the testing. With this patch, the dump_page count was reduced from 400 to 30. It would be also useful for memory-hotplug. Signed-off-by: Minchan Kim --- * from v1 - https://lore.kernel.org/lkml/20210302210949.2440120-1-minc...@kernel.org/ * introduce __lru_add_drain_all to minimize cha

Re: [PATCH 1/2] zram: fix crashes due to use of cpu hotplug multistate

2021-03-08 Thread Minchan Kim
On Sat, Mar 06, 2021 at 02:20:34AM +, Luis Chamberlain wrote: > The zram driver makes use of cpu hotplug multistate support, > whereby it associates a zram compression stream per CPU. To > support CPU hotplug multistate a callback enabled to allow > the driver to do what it needs when a CPU

Re: [kbuild-all] Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-08 Thread Minchan Kim
On Tue, Mar 09, 2021 at 08:41:44AM +0800, Rong Chen wrote: > > > On 3/9/21 6:29 AM, Minchan Kim wrote: > > On Tue, Mar 09, 2021 at 05:29:30AM +0800, kernel test robot wrote: > > > Hi Minchan, > > > > > > I love your patch! Perhaps something to impr

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-08 Thread Minchan Kim
On Mon, Mar 08, 2021 at 04:21:28PM -0800, Andrew Morton wrote: > On Mon, 8 Mar 2021 12:20:47 -0800 Minchan Kim wrote: > > > alloc_contig_range is usually used on cma area or movable zone. > > It's critical if the page migration fails on those areas so > > dum

Re: [PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-08 Thread Minchan Kim
On Tue, Mar 09, 2021 at 05:29:30AM +0800, kernel test robot wrote: > Hi Minchan, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on hnaz-linux-mm/master] > > url: > https://github.com/0day-ci/linux/commits/Minchan-Kim/mm-page_alloc-d

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-08 Thread Minchan Kim
On Mon, Mar 08, 2021 at 07:58:11AM -0800, Minchan Kim wrote: > On Mon, Mar 08, 2021 at 04:42:43PM +0100, Michal Hocko wrote: > > On Mon 08-03-21 15:13:35, David Hildenbrand wrote: > > > On 08.03.21 15:11, Michal Hocko wrote: > > > > On Mon 08-03-21 14:

[PATCH v2] mm: page_alloc: dump migrate-failed pages

2021-03-08 Thread Minchan Kim
helpful to find long term pinner who initiated the page allocation. Admin could enable the dump like this(by default, disabled) echo "func dump_migrate_failure_pages +p" > control Admin could disable it. echo "func dump_migrate_failure_pages =_" > control

Re: [mm] 9ddc8abf03: BUG:KASAN:null-ptr-deref_in_lockdep_init_map_type

2021-03-08 Thread Minchan Kim
30 > [ 16.845925] #PF: supervisor write access in kernel mode > [ 16.847149] #PF: error_code(0x0002) - not-present page > [ 16.848311] PGD 0 P4D 0 > [ 16.848311] Oops: 0002 [#1] SMP KASAN PTI > [ 16.848311] CPU: 0 PID: 1 Comm: swapper/0 Tainted: GB >

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-08 Thread Minchan Kim
On Mon, Mar 08, 2021 at 05:21:47PM +0100, Michal Hocko wrote: > On Mon 08-03-21 07:58:11, Minchan Kim wrote: > [...] > > It's the dynamic debugging facility > > to enable only when admin want to use it. Otherwise, it's nop > > unless is't not enabled. Furthermore, i

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-08 Thread Minchan Kim
On Mon, Mar 08, 2021 at 04:42:43PM +0100, Michal Hocko wrote: > On Mon 08-03-21 15:13:35, David Hildenbrand wrote: > > On 08.03.21 15:11, Michal Hocko wrote: > > > On Mon 08-03-21 14:22:12, David Hildenbrand wrote: > > > > On 08.03.21 13:49, Michal Hocko wrote: > > > [...] > > > > > Earlier in the

Re: [PATCH v4] mm: cma: support sysfs

2021-03-05 Thread Minchan Kim
On Fri, Mar 05, 2021 at 06:34:22PM +0100, David Hildenbrand wrote: > On 04.03.21 17:17, Minchan Kim wrote: > > Since CMA is getting used more widely, it's more important to > > keep monitoring CMA statistics for system health since it's > > directly related to user experience

Re: [PATCH 1/2] mm: disable LRU pagevec during the migration temporarily

2021-03-05 Thread Minchan Kim
On Fri, Mar 05, 2021 at 05:06:17PM +0100, Michal Hocko wrote: > On Wed 03-03-21 12:23:22, Minchan Kim wrote: > > On Wed, Mar 03, 2021 at 01:49:36PM +0100, Michal Hocko wrote: > > > On Tue 02-03-21 13:09:48, Minchan Kim wrote: > > > > LRU pagevec holds refco

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread Minchan Kim
On Thu, Mar 04, 2021 at 10:11:35AM -0800, Minchan Kim wrote: > On Thu, Mar 04, 2021 at 06:23:09PM +0100, David Hildenbrand wrote: > > > > You want to debug something, so you try triggering it and capturing > > > > debug > > > > data. There are n

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread Minchan Kim
On Thu, Mar 04, 2021 at 06:23:09PM +0100, David Hildenbrand wrote: > > > You want to debug something, so you try triggering it and capturing debug > > > data. There are not that many alloc_contig_range() users such that this > > > would really be an issue to isolate ... > > > > cma_alloc uses

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread Minchan Kim
On Thu, Mar 04, 2021 at 05:28:32PM +0100, David Hildenbrand wrote: > On 04.03.21 17:23, Minchan Kim wrote: > > On Thu, Mar 04, 2021 at 05:10:52PM +0100, David Hildenbrand wrote: > > > On 04.03.21 17:01, Minchan Kim wrote: > > > > On Tue, Mar 02, 2021 at 09:23

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread Minchan Kim
On Thu, Mar 04, 2021 at 05:10:52PM +0100, David Hildenbrand wrote: > On 04.03.21 17:01, Minchan Kim wrote: > > On Tue, Mar 02, 2021 at 09:23:49AM -0800, Minchan Kim wrote: > > > On Fri, Feb 19, 2021 at 10:28:12AM +0100, Michal Hocko wrote: > > > > On Thu 18-02-

[PATCH v4] mm: cma: support sysfs

2021-03-04 Thread Minchan Kim
-by: Minchan Kim --- >From v3 - >https://lore.kernel.org/linux-mm/20210303205053.2906924-1-minc...@kernel.org/ * kmalloc_array - akpm * add why cma_stat was implemented by dynamic allocation - akpm * use !__GFP_NOWARN facility to print error - akpm >From v2 - >https://lore.kernel.

Re: [PATCH] mm: be more verbose for alloc_contig_range faliures

2021-03-04 Thread Minchan Kim
On Tue, Mar 02, 2021 at 09:23:49AM -0800, Minchan Kim wrote: > On Fri, Feb 19, 2021 at 10:28:12AM +0100, Michal Hocko wrote: > > On Thu 18-02-21 08:19:50, Minchan Kim wrote: > > > On Thu, Feb 18, 2021 at 10:43:21AM +0100, David Hildenbrand wrote: > > > > On 18.0

Re: [PATCH 1/2] mm: disable LRU pagevec during the migration temporarily

2021-03-04 Thread Minchan Kim
On Thu, Mar 04, 2021 at 09:07:28AM +0100, David Hildenbrand wrote: > On 03.03.21 21:23, Minchan Kim wrote: > > On Wed, Mar 03, 2021 at 01:49:36PM +0100, Michal Hocko wrote: > > > On Tue 02-03-21 13:09:48, Minchan Kim wrote: > > > > LRU pagevec holds refcount of pages

Re: [PATCH v3] mm: cma: support sysfs

2021-03-04 Thread Minchan Kim
On Wed, Mar 03, 2021 at 10:09:57PM -0800, Andrew Morton wrote: > On Wed, 3 Mar 2021 17:38:12 -0800 Minchan Kim wrote: > > > > > #endif > > > > char name[CMA_MAX_NAME]; > > > > +#ifdef CONFIG_CMA_SYSFS > > > > + struct cma_st

Re: [PATCH v3] mm: cma: support sysfs

2021-03-03 Thread Minchan Kim
On Wed, Mar 03, 2021 at 02:44:49PM -0800, Andrew Morton wrote: > On Wed, 3 Mar 2021 12:50:53 -0800 Minchan Kim wrote: > > > Since CMA is getting used more widely, it's more important to > > keep monitoring CMA statistics for system health since it's > > directly re

  1   2   3   4   5   6   7   8   9   10   >