Re: [PATCH v21 17/19] mm/lru: replace pgdat lru_lock with lruvec lock

2020-11-11 Thread Vlastimil Babka
On 11/11/20 6:46 PM, Vlastimil Babka wrote: Acked-by: Vlastimil Babka Err, not yet, that was supposed for patch 16/17

Re: [PATCH v21 16/19] mm/swap.c: serialize memcg changes in pagevec_lru_move_fn

2020-11-11 Thread Vlastimil Babka
work, so __pagevec_lru_add() goes its own way. Reported-by: Hugh Dickins Signed-off-by: Alex Shi Acked-by: Hugh Dickins Acked-by: Johannes Weiner Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Acked-by: Vlastimil Babka --- mm/sw

Re: [PATCH v21 17/19] mm/lru: replace pgdat lru_lock with lruvec lock

2020-11-11 Thread Vlastimil Babka
rew Morton Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Yang Shi Cc: Matthew Wilcox Cc: Konstantin Khlebnikov Cc: Tejun Heo Cc: linux-kernel@vger.kernel.org Cc: linux...@kvack.org Cc: cgro...@vger.kernel.org Acked-by: Vlastimil Babka

Re: [PATCH v21 15/19] mm/compaction: do page isolation first in compaction

2020-11-11 Thread Vlastimil Babka
Cc: Matthew Wilcox Cc: linux-kernel@vger.kernel.org Cc: linux...@kvack.org Acked-by: Vlastimil Babka A question below: @@ -979,10 +995,6 @@ static bool too_many_isolated(pg_data_t *pgdat) goto isolate_abort; } - /* Recheck P

Re: [PATCH v21 14/19] mm/lru: introduce TestClearPageLRU

2020-11-11 Thread Vlastimil Babka
On 11/5/20 9:55 AM, Alex Shi wrote: Currently lru_lock still guards both lru list and page's lru bit, that's ok. but if we want to use specific lruvec lock on the page, we need to pin down the page's lruvec/memcg during locking. Just taking lruvec lock first may be undermined by the page's memcg

Re: [PATCH v21 13/19] mm/mlock: remove __munlock_isolate_lru_page

2020-11-11 Thread Vlastimil Babka
On 11/5/20 9:55 AM, Alex Shi wrote: The func only has one caller, remove it to clean up code and simplify code. Signed-off-by: Alex Shi Acked-by: Hugh Dickins Acked-by: Johannes Weiner Cc: Hugh Dickins Cc: Kirill A. Shutemov Cc: Vlastimil Babka Cc: Andrew Morton Cc: linux...@kvack.org Cc

Re: [PATCH v21 12/19] mm/mlock: remove lru_lock on TestClearPageMlocked

2020-11-11 Thread Vlastimil Babka
on __mod_zone_page_state which need change to mod_zone_page_state. Thanks! Signed-off-by: Alex Shi Acked-by: Hugh Dickins Acked-by: Johannes Weiner Cc: Kirill A. Shutemov Cc: Vlastimil Babka Cc: Andrew Morton Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Acked-by: Vlastimil Babka Nit

Re: [PATCH v21 07/19] mm: page_idle_get_page() does not need lru_lock

2020-11-11 Thread Vlastimil Babka
tly but not entirely prevented by page_count() check in ksm.c's write_protect_page(): that risk being shared with page_referenced() and not helped by lru_lock). Signed-off-by: Hugh Dickins Signed-off-by: Alex Shi Cc: Andrew Morton Cc: Vladimir Davydov Cc: Vlastimil Babka Cc: Minchan Kim Cc: Alex

Re: [PATCH v21 05/19] mm/vmscan: remove unnecessary lruvec adding

2020-11-11 Thread Vlastimil Babka
on.org: coding style fixes] Signed-off-by: Alex Shi Acked-by: Hugh Dickins Acked-by: Johannes Weiner Cc: Andrew Morton Cc: Johannes Weiner Cc: Tejun Heo Cc: Matthew Wilcox Cc: Hugh Dickins Cc: linux...@kvack.org Cc: linux-kernel@vger.kernel.org Acked-by: Vlastimil Babka Nice cleanup!

Re: [PATCH v1] mm/page_alloc: clear pages in alloc_contig_pages() with init_on_alloc=1 or __GFP_ZERO

2020-11-11 Thread Vlastimil Babka
On 11/11/20 10:06 AM, David Hildenbrand wrote: On 11.11.20 09:47, Michal Hocko wrote: On Tue 10-11-20 20:32:40, David Hildenbrand wrote: commit 6471384af2a6 ("mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options") resulted with init_on_alloc=1 in all pages leaving the buddy

[PATCH v3 4/7] mm, page_alloc: simplify pageset_update()

2020-11-11 Thread Vlastimil Babka
ary read tearing, but mainly to alert anybody making future changes to the code that special care is needed. Signed-off-by: Vlastimil Babka Reviewed-by: Oscar Salvador Acked-by: David Hildenbrand Acked-by: Michal Hocko --- mm/page_alloc.c | 40 ++-- 1 file change

[PATCH v3 2/7] mm, page_alloc: calculate pageset high and batch once per zone

2020-11-11 Thread Vlastimil Babka
the zone_pageset_init() and __zone_pcp_update() wrappers. No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: Oscar Salvador Reviewed-by: David Hildenbrand Acked-by: Michal Hocko --- mm/page_alloc.c | 42 ++ 1 file changed, 18 insertions(+), 24 deletions

[PATCH v3 6/7] mm, page_alloc: move draining pcplists to page isolation users

2020-11-11 Thread Vlastimil Babka
-by: David Hildenbrand Suggested-by: Pavel Tatashin Signed-off-by: Vlastimil Babka Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Acked-by: Michal Hocko --- mm/memory_hotplug.c | 11 ++- mm/page_alloc.c | 2 ++ mm/page_isolation.c | 10 +- 3 files changed, 13

[PATCH v3 3/7] mm, page_alloc: remove setup_pageset()

2020-11-11 Thread Vlastimil Babka
. No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Acked-by: Michal Hocko --- mm/page_alloc.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2fa432762908

[PATCH v3 0/7] disable pcplists during memory offline

2020-11-11 Thread Vlastimil Babka
m/3d3b53db-aeaa-ff24-260b-36427fac9...@suse.cz/ [7] https://lore.kernel.org/linux-mm/20200922143712.12048-1-vba...@suse.cz/ [8] https://lore.kernel.org/linux-mm/20201008114201.18824-1-vba...@suse.cz/ Vlastimil Babka (7): mm, page_alloc: clean up pageset high and batch update mm, page_alloc: ca

[PATCH v3 7/7] mm, page_alloc: disable pcplists during memory offline

2020-11-11 Thread Vlastimil Babka
users of zone_pcp_disable()/enable(). Currently the only user of this functionality is offline_pages(). Suggested-by: David Hildenbrand Suggested-by: Michal Hocko Signed-off-by: Vlastimil Babka Reviewed-by: Oscar Salvador Acked-by: Michal Hocko --- mm/internal.h | 2 ++ mm/memory_hotplug.c |

[PATCH v3 1/7] mm, page_alloc: clean up pageset high and batch update

2020-11-11 Thread Vlastimil Babka
wrappers was: build_all_zonelists_init() setup_pageset() pageset_set_batch() which was hardcoding batch as 0, so we can just open-code a call to pageset_update() with constant parameters instead. No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: Oscar Salvador Reviewed-by: David

[PATCH v3 5/7] mm, page_alloc: cache pageset high and batch in struct zone

2020-11-11 Thread Vlastimil Babka
-by: Vlastimil Babka Reviewed-by: Oscar Salvador Acked-by: Michal Hocko --- include/linux/mmzone.h | 6 ++ mm/page_alloc.c| 16 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 7385871768d4

Re: [PATCH v5 1/5] mm: introduce debug_pagealloc_{map,unmap}_pages() helpers

2020-11-09 Thread Vlastimil Babka
On 11/8/20 7:57 AM, Mike Rapoport wrote: --- a/mm/slab.c +++ b/mm/slab.c @@ -1428,21 +1428,19 @@ static bool is_debug_pagealloc_cache(struct kmem_cache *cachep) return false; } -#ifdef CONFIG_DEBUG_PAGEALLOC static void slab_kernel_map(struct kmem_cache *cachep, void *objp, int

Re: Higher slub memory consumption on 64K page-size systems?

2020-11-05 Thread Vlastimil Babka
On 10/28/20 6:50 AM, Bharata B Rao wrote: slub_max_order -- The most promising tunable that shows consistent reduction in slab memory is slub_max_order. Here is a table that shows the number of slabs that end up with different orders and the total slab consumption at boot for

Re: [RFC PATCH 0/2] mm: fix OOMs for binding workloads to movable zone only node

2020-11-05 Thread Vlastimil Babka
On 11/5/20 2:19 PM, Michal Hocko wrote: On Thu 05-11-20 14:14:25, Vlastimil Babka wrote: On 11/5/20 1:58 PM, Michal Hocko wrote: > On Thu 05-11-20 13:53:24, Vlastimil Babka wrote: > > On 11/5/20 1:08 PM, Michal Hocko wrote: > > > On Thu 05-11-20 09:40:28, Feng Tang wrote: >

Re: [RFC PATCH 0/2] mm: fix OOMs for binding workloads to movable zone only node

2020-11-05 Thread Vlastimil Babka
On 11/5/20 1:58 PM, Michal Hocko wrote: On Thu 05-11-20 13:53:24, Vlastimil Babka wrote: On 11/5/20 1:08 PM, Michal Hocko wrote: > On Thu 05-11-20 09:40:28, Feng Tang wrote: > > > > Could you be more specific? This sounds like a bug. Allocations > > > shouldn't sp

Re: [RFC PATCH 0/2] mm: fix OOMs for binding workloads to movable zone only node

2020-11-05 Thread Vlastimil Babka
On 11/5/20 1:08 PM, Michal Hocko wrote: On Thu 05-11-20 09:40:28, Feng Tang wrote: > > Could you be more specific? This sounds like a bug. Allocations > shouldn't spill over to a node which is not in the cpuset. There are few > exceptions like IRQ context but that shouldn't happen regurarly.

Re: Regression: QCA6390 fails with "mm/page_alloc: place pages to tail in __free_pages_core()"

2020-11-05 Thread Vlastimil Babka
On 11/5/20 10:04 AM, Kalle Valo wrote: (changing the subject, adding more lists and people) Pavel Procopiuc writes: Op 04.11.2020 om 10:12 schreef Kalle Valo: Yeah, it is unfortunately time consuming but it is the best way to get bottom of this. I have found the commit that breaks things

Re: [PATCH v4 3/4] arch, mm: restore dependency of __kernel_map_pages() of DEBUG_PAGEALLOC

2020-11-04 Thread Vlastimil Babka
On 11/3/20 5:20 PM, Mike Rapoport wrote: From: Mike Rapoport Subject should have "on DEBUG_PAGEALLOC" ? The design of DEBUG_PAGEALLOC presumes that __kernel_map_pages() must never fail. With this assumption is wouldn't be safe to allow general usage of this function. Moreover, some

Re: [PATCH v4 2/4] PM: hibernate: make direct map manipulations more explicit

2020-11-04 Thread Vlastimil Babka
,invalid}_noflush(). Still, add a pr_warn() so that future changes in set_memory APIs will not silently break hibernation. Signed-off-by: Mike Rapoport Acked-by: Rafael J. Wysocki Reviewed-by: David Hildenbrand Acked-by: Kirill A. Shutemov Acked-by: Vlastimil Babka The bool param is a bit

Re: [PATCH v4 1/4] mm: introduce debug_pagealloc_map_pages() helper

2020-11-04 Thread Vlastimil Babka
when page allocation debug is enabled. Signed-off-by: Mike Rapoport Reviewed-by: David Hildenbrand Acked-by: Kirill A. Shutemov Acked-by: Vlastimil Babka But, the "enable" param is hideous. I would rather have map and unmap variants (and just did the same split for page

[PATCH v2 0/5] cleanup page poisoning

2020-11-03 Thread Vlastimil Babka
be removed now that we have init_on_free (Patch 4) - CONFIG_PAGE_POISONING_ZERO can be most likely removed now that we have init_on_free (Patch 5) [1] https://lore.kernel.org/r/20201026173358.14704-1-vba...@suse.cz Vlastimil Babka (5): mm, page_alloc: do not rely on the order of p

[PATCH v2 1/5] mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters

2020-11-03 Thread Vlastimil Babka
. This results in a simpler and more effective code. Signed-off-by: Vlastimil Babka Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport --- include/linux/mm.h | 20 ++- init/main.c| 2 +- mm/page_alloc.c| 88 ++ 3 files changed

[PATCH v2 4/5] mm, page_poison: remove CONFIG_PAGE_POISONING_NO_SANITY

2020-11-03 Thread Vlastimil Babka
t checking it back on alloc. Thus, remove this option and suggest init_on_free instead in the main config's help. Signed-off-by: Vlastimil Babka --- drivers/virtio/virtio_balloon.c | 4 +--- mm/Kconfig.debug| 15 --- mm/page_poison.c| 3 --- 3 files

[PATCH v2 3/5] kernel/power: allow hibernation with page_poison sanity checking

2020-11-03 Thread Vlastimil Babka
We can use the same mechanism to instead poison free pages with PAGE_POISON after resume. This covers both zero and 0xAA patterns. Thus we can remove the Kconfig restriction that disables page poison sanity checking when hibernation is enabled. Signed-off-by: Vlastimil Babka Cc: "Rafael J. Wy

[PATCH v2 5/5] mm, page_poison: remove CONFIG_PAGE_POISONING_ZERO

2020-11-03 Thread Vlastimil Babka
us, remove the CONFIG_PAGE_POISONING_ZERO option for being redundant. Signed-off-by: Vlastimil Babka --- include/linux/poison.h | 4 mm/Kconfig.debug | 12 mm/page_alloc.c | 8 +--- tools/include/linux/poison.h | 6 +- 4 files changed, 2

[PATCH v2 2/5] mm, page_poison: use static key more efficiently

2020-11-03 Thread Vlastimil Babka
oc support. Move the check to init_mem_debugging_and_hardening() to enable a single static key instead of having two static branches in page_poisoning_enabled_static(). Signed-off-by: Vlastimil Babka --- drivers/virtio/virtio_balloon.c | 2 +- include/linux/mm.h | 23

Re: [PATCH v2] mm/list_lru: optimize condition of exiting the loop

2020-11-02 Thread Vlastimil Babka
e precise. Yes, imho comparisons that make no sense are only misleading for the readers. Compilers can probably find out easier, so maybe there's no code generation change, but for making it less misleading: Signed-off-by: Hui Su Acked-by: Vlastimil Babka --- include/linux/list_

Re: [PATCH v3 2/2] mm/compaction: stop isolation if too many pages are isolated and we have pages to migrate.

2020-11-02 Thread Vlastimil Babka
COMPACT_CLUSTER_MAX, and loop forever in the while loop. Bailing immediately prevents that. Fixes: 1da2f328fa64 (“mm,thp,compaction,cma: allow THP migration for CMA allocations”) Suggested-by: Vlastimil Babka Signed-off-by: Zi Yan Cc: Acked-by: Vlastimil Babka --- mm/compaction.c | 4

Re: [PATCH v3 1/2] mm/compaction: count pages and stop correctly during page isolation.

2020-11-02 Thread Vlastimil Babka
ted function) until we kill either task. With the patch applied, oom will kill the application with 10GB THPs and let hugetlb page reservation finish. Fixes: 1da2f328fa64 (“mm,thp,compaction,cma: allow THP migration for CMA allocations”) Signed-off-by: Zi Yan Reviewed-by: Yang Shi Cc: Acked-b

Re: [PATCH] mm/compaction: count pages and stop correctly during page isolation.

2020-11-02 Thread Vlastimil Babka
On 10/30/20 7:55 PM, Yang Shi wrote: On Fri, Oct 30, 2020 at 11:39 AM Zi Yan wrote: On 30 Oct 2020, at 14:33, Yang Shi wrote: > On Fri, Oct 30, 2020 at 6:36 AM Michal Hocko wrote: >> >> On Fri 30-10-20 08:20:50, Zi Yan wrote: >>> On 30 Oct 2020, at 5:43, Michal Hocko wrote: >>> [Cc

Re: [PATCH v5 1/1] mmap_lock: add tracepoints around lock acquisition

2020-11-02 Thread Vlastimil Babka
a performance impact, but how much depends on exactly what e.g. the BPF program does. [ rost...@goodmis.org: in-depth examples of tracepoint_enabled() usage, and per-cpu-per-context buffer design ] Great, thanks Steven. Signed-off-by: Axel Rasmussen Acked-by: Vlastimil Babka

Re: [PATCH 2/3] mm, page_poison: use static key more efficiently

2020-10-30 Thread Vlastimil Babka
On 10/30/20 5:27 PM, Luis Chamberlain wrote: On Mon, Oct 26, 2020 at 06:33:57PM +0100, Vlastimil Babka wrote: Commit 11c9c7edae06 ("mm/page_poison.c: replace bool variable with static key") changed page_poisoning_enabled() to a static key check. However, the function is not inline

Re: [PATCH] mm/compaction: count pages and stop correctly during page isolation.

2020-10-30 Thread Vlastimil Babka
On 10/30/20 3:49 PM, Michal Hocko wrote: On Fri 30-10-20 10:35:43, Zi Yan wrote: On 30 Oct 2020, at 9:36, Michal Hocko wrote: > On Fri 30-10-20 08:20:50, Zi Yan wrote: >> On 30 Oct 2020, at 5:43, Michal Hocko wrote: >> >>> [Cc Vlastimil] >>> >>> On Thu 29-10-20 16:04:35, Zi Yan wrote: >>> >>>

Re: [PATCH] mm/compaction: count pages and stop correctly during page isolation.

2020-10-30 Thread Vlastimil Babka
On 10/29/20 9:04 PM, Zi Yan wrote: From: Zi Yan In isolate_migratepages_block, when cc->alloc_contig is true, we are able to isolate compound pages, nr_migratepages and nr_isolated did not count compound pages correctly, causing us to isolate more pages than we thought. Use thp_nr_pages to

Re: [PATCH] mm/list_lru: optimize condition of exiting the loop

2020-10-27 Thread Vlastimil Babka
On 10/27/20 6:04 PM, Hui Su wrote: In list_lru_walk(), nr_to_walk type is 'unsigned long', so nr_to_walk won't be '< 0'. In list_lru_walk_node(), nr_to_walk type is 'unsigned long', so *nr_to_walk won't be '< 0' too. We can use '!nr_to_walk' instead of 'nr_to_walk <= 0', which is more precise.

Re: [PATCH 1/8] mm: slab: provide krealloc_array()

2020-10-27 Thread Vlastimil Babka
who use regular krealloc() to reallocate arrays. Let's provide an actual krealloc_array() implementation. Signed-off-by: Bartosz Golaszewski Makes sense. Acked-by: Vlastimil Babka --- include/linux/slab.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/include/linux/slab.h

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-27 Thread Vlastimil Babka
On 10/27/20 2:32 PM, Vlastimil Babka wrote: So my conclusion: - We can remove PAGE_POISONING_NO_SANITY because it only makes sense with PAGE_POISONING_ZERO, and we can use init_on_free instead Note for this we first have to make sanity checking compatible with hibernation, but that should

Re: [PATCH] mm/slub: fix panic in slab_alloc_node()

2020-10-27 Thread Vlastimil Babka
d when it is called. It happens that this is not true in that particular case, so check for page before calling node_match() here. Fixes: 6159d0f5c03e ("mm/slub.c: page is always non-NULL in node_match()") Signed-off-by: Laurent Dufour With the expanded changelog, Acked-by: Vlastimil B

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-27 Thread Vlastimil Babka
On 10/27/20 12:05 PM, Vlastimil Babka wrote: On 10/27/20 10:10 AM, David Hildenbrand wrote: On 26.10.20 18:33, Vlastimil Babka wrote: prep_new_page() will always zero a new page (regardless of __GFP_ZERO) when init_on_alloc is enabled, but will also always skip zeroing if the page was already

Re: [PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-27 Thread Vlastimil Babka
On 10/27/20 10:10 AM, David Hildenbrand wrote: On 26.10.20 18:33, Vlastimil Babka wrote: prep_new_page() will always zero a new page (regardless of __GFP_ZERO) when init_on_alloc is enabled, but will also always skip zeroing if the page was already zeroed on free by init_on_free or page

Re: [PATCH 1/3] mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters

2020-10-27 Thread Vlastimil Babka
On 10/27/20 10:03 AM, David Hildenbrand wrote: On 26.10.20 18:33, Vlastimil Babka wrote: Enabling page_poison=1 together with init_on_alloc=1 or init_on_free=1 produces a warning in dmesg that page_poison takes precendence. However, as these warnings are printed in early_param handlers

[PATCH 3/3] mm, page_alloc: reduce static keys in prep_new_page()

2020-10-26 Thread Vlastimil Babka
keys. As prep_new_page() is really a hot path, let's introduce a single static key free_pages_not_prezeroed for this purpose and initialize it in init_mem_debugging(). Signed-off-by: Vlastimil Babka --- mm/page_alloc.c | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions

[PATCH 2/3] mm, page_poison: use static key more efficiently

2020-10-26 Thread Vlastimil Babka
es without proper debug_pagealloc support. Move the check to init_mem_debugging() to enable a single static key instead of having two static branches in page_poisoning_enabled_static(). Signed-off-by: Vlastimil Babka --- drivers/virtio/virtio_balloon.c | 2 +- include/linux/mm.h

[PATCH 1/3] mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters

2020-10-26 Thread Vlastimil Babka
and more effective code. Signed-off-by: Vlastimil Babka --- include/linux/mm.h | 20 ++ init/main.c| 2 +- mm/page_alloc.c| 94 +++--- 3 files changed, 50 insertions(+), 66 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h

[PATCH 0/3] optimize handling of memory debugging parameters

2020-10-26 Thread Vlastimil Babka
of parameters is also eliminated (Patch 1). The result is more efficient and hopefully also more readable code. Vlastimil Babka (3): mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters mm, page_poison: use static key more efficiently mm, page_alloc

Re: [PATCH v4 1/1] mmap_lock: add tracepoints around lock acquisition

2020-10-23 Thread Vlastimil Babka
On 10/23/20 7:38 PM, Axel Rasmussen wrote: On Fri, Oct 23, 2020 at 7:00 AM Vlastimil Babka wrote: On 10/20/20 8:47 PM, Axel Rasmussen wrote: > The goal of these tracepoints is to be able to debug lock contention > issues. This lock is acquired on most (all?) mmap / munmap / page

Re: [PATCH v4 1/1] mmap_lock: add tracepoints around lock acquisition

2020-10-23 Thread Vlastimil Babka
On 10/20/20 8:47 PM, Axel Rasmussen wrote: The goal of these tracepoints is to be able to debug lock contention issues. This lock is acquired on most (all?) mmap / munmap / page fault operations, so a multi-threaded process which does a lot of these can experience significant contention. We

Re: [PATCH] mm/cma.c: remove redundant cma_mutex lock

2020-10-23 Thread Vlastimil Babka
s off), but should be good enough for now. Agreed. Acked-by: David Hildenbrand Acked-by: Vlastimil Babka

Re: [PATCH v2] mm,thp,shmem: limit shmem THP alloc gfp_mask

2020-10-22 Thread Vlastimil Babka
ik van Riel Acked-by: Vlastimil Babka --- v2: move gfp calculation to shmem_getpage_gfp as suggested by Yu Xu diff --git a/include/linux/gfp.h b/include/linux/gfp.h index c603237e006c..0a5b164a26d9 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -614,6 +614,8 @@ bool gfp_pfmemalloc_al

Re: [PATCH] mm,thp,shmem: limit shmem THP alloc gfp_mask

2020-10-22 Thread Vlastimil Babka
On 10/22/20 4:51 PM, Vlastimil Babka wrote: On 10/22/20 5:48 AM, Rik van Riel wrote: The allocation flags of anonymous transparent huge pages can be controlled through the files in /sys/kernel/mm/transparent_hugepage/defrag, which can help the system from getting bogged down in the page reclaim

Re: [PATCH] mm,thp,shmem: limit shmem THP alloc gfp_mask

2020-10-22 Thread Vlastimil Babka
On 10/22/20 5:48 AM, Rik van Riel wrote: The allocation flags of anonymous transparent huge pages can be controlled through the files in /sys/kernel/mm/transparent_hugepage/defrag, which can help the system from getting bogged down in the page reclaim and compaction code when many THPs are

Re: [PATCH v2 5/5] mm/memory_hotplug: update comment regarding zone shuffling

2020-10-20 Thread Vlastimil Babka
Babka Cc: Andrew Morton Cc: Alexander Duyck Cc: Mel Gorman Cc: Michal Hocko Cc: Dave Hansen Cc: Vlastimil Babka Cc: Wei Yang Cc: Oscar Salvador Cc: Mike Rapoport Cc: Pankaj Gupta Signed-off-by: David Hildenbrand --- mm/memory_hotplug.c | 11 --- 1 file changed, 4 insertions

Re: [PATCH v2 3/5] mm/page_alloc: move pages to tail in move_to_free_list()

2020-10-20 Thread Vlastimil Babka
ase this instance and add a proper comment. This change results in all pages getting onlined via online_pages() to be placed to the tail of the freelist. Reviewed-by: Oscar Salvador Acked-by: Pankaj Gupta Reviewed-by: Wei Yang Reviewed-by: Vlastimil Babka

Re: [PATCH v2 2/5] mm/page_alloc: place pages to tail in __putback_isolated_page()

2020-10-20 Thread Vlastimil Babka
ed-by: Michal Hocko Reviewed-by: Vlastimil Babka

Re: mm: Question about the use of 'accessed' flags and pte_young() helper

2020-10-20 Thread Vlastimil Babka
On 10/8/20 11:49 AM, Christophe Leroy wrote: In a 10 years old commit (https://github.com/linuxppc/linux/commit/d069cb4373fe0d451357c4d3769623a7564dfa9f), powerpc 8xx has made the handling of PTE accessed bit conditional to CONFIG_SWAP. Since then, this has been extended to some other powerpc

Re: [PATCH v3 2/2] mmap_lock: add tracepoints around lock acquisition

2020-10-20 Thread Vlastimil Babka
On 10/10/20 12:05 AM, Axel Rasmussen wrote: The goal of these tracepoints is to be able to debug lock contention issues. This lock is acquired on most (all?) mmap / munmap / page fault operations, so a multi-threaded process which does a lot of these can experience significant contention. We

Re: [PATCH 2/3 v2] mm/page_ref: Convert the open coded tracepoint enabled to the new helper

2020-10-20 Thread Vlastimil Babka
th minimal header requirements (avoid "include hell"). Convert the page_ref logic over to the new helper macro. Cc: Joonsoo Kim Cc: Michal Nazarewicz Cc: Vlastimil Babka Cc: Minchan Kim Cc: Mel Gorman Cc: "Kirill A. Shutemov" Cc: Sergey Senozhatsky Cc: Arnd Bergmann

Re: [PATCH 1/3 v2] tracepoints: Add helper to test if tracepoint is enabled in a header

2020-10-20 Thread Vlastimil Babka
en Rostedt (VMware) Nice! I'm late here, but you mentioned a v3, so FWIW: Acked-by: Vlastimil Babka

Re: [PATCH v2] mm/compaction: Rename 'start_pfn' to 'iteration_start_pfn' in compact_zone()

2020-10-19 Thread Vlastimil Babka
On 10/19/20 12:29 PM, Xu, Yanfei wrote: On 10/19/20 5:40 PM, Vlastimil Babka wrote: On 10/19/20 10:36 AM, yanfei...@windriver.com wrote: From: Yanfei Xu There are two 'start_pfn' declared in compact_zone() which have different meaning. Rename the second one to 'iteration_start_pfn

Re: [PATCH v2] mm/compaction: Rename 'start_pfn' to 'iteration_start_pfn' in compact_zone()

2020-10-19 Thread Vlastimil Babka
usion.", because trace_mm_compaction_end() has the correct value even before the patch - the second start_pfn is out of scope at that point. Thanks BTW, remove an useless semicolon. Acked-by: David Hildenbrand Acked-by: Vlastimil Babka Signed-off-by: Yanfei Xu --- v1->v2: Rena

Re: [PATCH] mm/slub: make add_full() condition more explicit

2020-10-16 Thread Vlastimil Babka
spin_lock(>list_lock); } +#endif } if (l != m) { Hm I missed this, otherwise I would have suggested the following -8<- From 0b43c7e20c81241f4b74cdb366795fc0b94a25c9 Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: Fri, 16 Oct 2020 18:46:

Re: [External] Re: [PATCH] mm: proc: add Sock to /proc/meminfo

2020-10-16 Thread Vlastimil Babka
On 10/13/20 10:09 AM, Mike Rapoport wrote: We are not complaining about TCP using too much memory, but how do we know that TCP uses a lot of memory. When I firstly face this problem, I do not know who uses the 25GB memory and it is not shown in the /proc/meminfo. If we can know the amount memory

Re: [PATCH] mm/compaction: Remove some useless code in compact_zone()

2020-10-16 Thread Vlastimil Babka
On 10/14/20 2:28 PM, David Hildenbrand wrote: On 14.10.20 09:23, yanfei...@windriver.com wrote: From: Yanfei Xu start_pfn has been declared at the begin of compact_zone(), it's no need to declare it again. And remove an useless semicolon. Signed-off-by: Yanfei Xu --- mm/compaction.c | 3

Re: [PATCH] mm: fix page_owner initializing issue for arm32

2020-10-16 Thread Vlastimil Babka
: Acked-by: Vlastimil Babka Nit below: --- include/linux/page_ext.h | 8 init/main.c | 2 ++ mm/page_ext.c| 8 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/linux/page_ext.h b/include/linux/page_ext.h index cfce186..aff81ba

Re: [PATCH v3 0/3] Actually fix freelist pointer vs redzoning

2020-10-15 Thread Vlastimil Babka
On 10/15/20 10:23 AM, Christopher Lameter wrote: On Wed, 14 Oct 2020, Kees Cook wrote: Note on patch 2: Christopher NAKed it, but I actually think this is a reasonable thing to add -- the "too small" check is only made when built with CONFIG_DEBUG_VM, so it *is* actually possible for someone

Re: [PATCH v2 3/3] mm/slub: Actually fix freelist pointer vs redzoning

2020-10-13 Thread Vlastimil Babka
.google.com/ Fixes: 89b83f282d8b (slub: avoid redzone when choosing freepointer location) Tested-by: Marco Elver Link: https://lore.kernel.org/lkml/canpmjnowz5vpkqn+sywovtkfb4vst-rpwyenbmak0dlcpqs...@mail.gmail.com Signed-off-by: Kees Cook Acked-by: Vlastimil Babka This struggle to get

Re: [PATCH v2 1/3] mm/slub: Clarify verification reporting

2020-10-13 Thread Vlastimil Babka
port left redzone") Fixes: ffc79d288000 ("slub: use print_hex_dump") Fixes: 2492268472e7 ("SLUB: change error reporting format to follow lockdep loosely") Not sure about those Fixes: tag as this is mainly an enhancement. I'd only use those for real bug fixes. Signed-off-by: Kees Cook Acked-by: Vlastimil Babka

Re: [PATCH v2 5/7] mm, page_alloc: cache pageset high and batch in struct zone

2020-10-08 Thread Vlastimil Babka
On 10/8/20 2:31 PM, Michal Hocko wrote: On Thu 08-10-20 13:41:59, Vlastimil Babka wrote: All per-cpu pagesets for a zone use the same high and batch values, that are duplicated there just for performance (locality) reasons. This patch adds the same variables also to struct zone as a shared copy

Re: [PATCH v2 7/7] mm, page_alloc: disable pcplists during memory offline

2020-10-08 Thread Vlastimil Babka
On 10/8/20 2:45 PM, Michal Hocko wrote: On Thu 08-10-20 13:42:01, Vlastimil Babka wrote: Memory offline relies on page isolation can race with process freeing pages to pcplists in a way that a page from isolated pageblock can end up on pcplist. "Memory offlining relies on page isol

Re: [PATCH v2 3/7] mm, page_alloc: remove setup_pageset()

2020-10-08 Thread Vlastimil Babka
On 10/8/20 2:23 PM, Michal Hocko wrote: On Thu 08-10-20 13:41:57, Vlastimil Babka wrote: We initialize boot-time pagesets with setup_pageset(), which sets high and batch values that effectively disable pcplists. We can remove this wrapper if we just set these values for all pagesets

[PATCH v2 1/7] mm, page_alloc: clean up pageset high and batch update

2020-10-08 Thread Vlastimil Babka
wrappers was: build_all_zonelists_init() setup_pageset() pageset_set_batch() which was hardcoding batch as 0, so we can just open-code a call to pageset_update() with constant parameters instead. No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: Oscar Salvador Reviewed-by: David

[PATCH v2 2/7] mm, page_alloc: calculate pageset high and batch once per zone

2020-10-08 Thread Vlastimil Babka
the zone_pageset_init() and __zone_pcp_update() wrappers. No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: Oscar Salvador Reviewed-by: David Hildenbrand Acked-by: Michal Hocko --- mm/page_alloc.c | 42 ++ 1 file changed, 18 insertions(+), 24 deletions

[PATCH v2 0/7] disable pcplists during memory offline

2020-10-08 Thread Vlastimil Babka
.kernel.org/linux-mm/20200909113647.gg7...@dhcp22.suse.cz/ [5] https://lore.kernel.org/linux-mm/20200904151448.100489-3-pasha.tatas...@soleen.com/ [6] https://lore.kernel.org/linux-mm/3d3b53db-aeaa-ff24-260b-36427fac9...@suse.cz/ [7] https://lore.kernel.org/linux-mm/20200922143712.12048-1-vba...@suse.cz/

[PATCH v2 6/7] mm, page_alloc: move draining pcplists to page isolation users

2020-10-08 Thread Vlastimil Babka
-by: David Hildenbrand Suggested-by: Pavel Tatashin Signed-off-by: Vlastimil Babka Reviewed-by: David Hildenbrand Acked-by: Michal Hocko --- mm/memory_hotplug.c | 11 ++- mm/page_alloc.c | 2 ++ mm/page_isolation.c | 10 +- 3 files changed, 13 insertions(+), 10 deletions

[PATCH v2 3/7] mm, page_alloc: remove setup_pageset()

2020-10-08 Thread Vlastimil Babka
. No functional change. Signed-off-by: Vlastimil Babka Reviewed-by: David Hildenbrand --- mm/page_alloc.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 463f40b12aca..f827b42a2475 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c

[PATCH v2 5/7] mm, page_alloc: cache pageset high and batch in struct zone

2020-10-08 Thread Vlastimil Babka
-by: Vlastimil Babka --- include/linux/mmzone.h | 6 ++ mm/page_alloc.c| 17 +++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index fb3bf696c05e..c63863794afc 100644 --- a/include/linux/mmzone.h +++ b

[PATCH v2 7/7] mm, page_alloc: disable pcplists during memory offline

2020-10-08 Thread Vlastimil Babka
s(). Suggested-by: David Hildenbrand Suggested-by: Michal Hocko Signed-off-by: Vlastimil Babka --- mm/internal.h | 2 ++ mm/memory_hotplug.c | 28 -- mm/page_alloc.c | 69 +++-- mm/page_isolation.c | 6 ++-- 4 files changed, 71 in

[PATCH v2 4/7] mm, page_alloc: simplify pageset_update()

2020-10-08 Thread Vlastimil Babka
ary read tearing, but mainly to alert anybody making future changes to the code that special care is needed. Signed-off-by: Vlastimil Babka Acked-by: David Hildenbrand Acked-by: Michal Hocko --- mm/page_alloc.c | 40 ++-- 1 file changed, 18 insertions(+), 22 de

Re: [PATCH 6/9] mm, page_alloc: cache pageset high and batch in struct zone

2020-10-06 Thread Vlastimil Babka
On 10/5/20 3:28 PM, Michal Hocko wrote: On Tue 22-09-20 16:37:09, Vlastimil Babka wrote: All per-cpu pagesets for a zone use the same high and batch values, that are duplicated there just for performance (locality) reasons. This patch adds the same variables also to struct zone as a shared copy

Re: [PATCH 6/9] mm, page_alloc: cache pageset high and batch in struct zone

2020-10-06 Thread Vlastimil Babka
On 9/25/20 12:34 PM, David Hildenbrand wrote: On 22.09.20 16:37, Vlastimil Babka wrote: @@ -6300,6 +6310,8 @@ static __meminit void zone_pcp_init(struct zone *zone) * offset of a (static) per cpu variable into the per cpu area. */ zone->pageset = _pageset; + z

Re: [PATCH 5/9] mm, page_alloc: make per_cpu_pageset accessible only after init

2020-10-06 Thread Vlastimil Babka
On 10/5/20 3:24 PM, Michal Hocko wrote: On Tue 22-09-20 16:37:08, Vlastimil Babka wrote: setup_zone_pageset() replaces the boot_pageset by allocating and initializing a proper percpu one. Currently it assigns zone->pageset with the newly allocated one before initializing it. That's curren

Re: [PATCH 3/9] mm, page_alloc: remove setup_pageset()

2020-10-06 Thread Vlastimil Babka
On 10/5/20 2:59 PM, Michal Hocko wrote: On Tue 22-09-20 16:37:06, Vlastimil Babka wrote: We initialize boot-time pagesets with setup_pageset(), which sets high and batch values that effectively disable pcplists. We can remove this wrapper if we just set these values for all pagesets

Re: [PATCH 2/9] mm, page_alloc: calculate pageset high and batch once per zone

2020-10-06 Thread Vlastimil Babka
On 10/5/20 2:52 PM, Michal Hocko wrote: On Tue 22-09-20 16:37:05, Vlastimil Babka wrote: We currently call pageset_set_high_and_batch() for each possible cpu, which repeats the same calculations of high and batch values. Instead call the function just once per zone, and make it apply

Re: [PATCH 9/9] mm, page_alloc: optionally disable pcplists during page isolation

2020-10-05 Thread Vlastimil Babka
On 10/5/20 4:05 PM, Michal Hocko wrote: > On Fri 25-09-20 13:10:05, Vlastimil Babka wrote: >> On 9/25/20 12:54 PM, David Hildenbrand wrote: >> >> Hmm that temporary write lock would still block new callers until previous >> finish with the downgraded-to-read lock. >&

Re: Linux 5.9-rc7 / VmallocTotal wrongly reported

2020-10-02 Thread Vlastimil Babka
; non-SMP version of __mod_node_page_state(). > > Signed-off-by: Roman Gushchin > Reported-by: Bastian Bittorf > Fixes: ea426c2a7de8 ("mm: memcg: prepare for byte-sized vmstat items") Acked-by: Vlastimil Babka For consistency we could also duplicate the "VM_WARN_ON_O

Re: [RFC-PATCH 2/4] mm: Add __rcu_alloc_page_lockless() func.

2020-09-30 Thread Vlastimil Babka
On 9/30/20 12:07 AM, Uladzislau Rezki wrote: > On Tue, Sep 29, 2020 at 12:15:34PM +0200, Vlastimil Babka wrote: >> On 9/18/20 9:48 PM, Uladzislau Rezki (Sony) wrote: >> >> After reading all the threads and mulling over this, I am going to deflect >> from >> Mel a

Re: [RFC-PATCH 2/4] mm: Add __rcu_alloc_page_lockless() func.

2020-09-29 Thread Vlastimil Babka
On 9/18/20 9:48 PM, Uladzislau Rezki (Sony) wrote: > Some background and kfree_rcu() > === > The pointers to be freed are stored in the per-cpu array to improve > performance, to enable an easier-to-use API, to accommodate vmalloc > memmory and to support a single

Re: [PATCH v2 for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs

2020-09-29 Thread Vlastimil Babka
ded completely with !CONFIG_CMA. Acked-by: Vlastimil Babka > --- > mm/page_alloc.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index fab5e97..104d2e1 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_al

Re: [PATCH 9/9] mm, page_alloc: optionally disable pcplists during page isolation

2020-09-25 Thread Vlastimil Babka
On 9/25/20 12:54 PM, David Hildenbrand wrote: >>> --- a/mm/page_isolation.c >>> +++ b/mm/page_isolation.c >>> @@ -15,6 +15,22 @@ >>> #define CREATE_TRACE_POINTS >>> #include >>> >>> +void zone_pcplist_disable(struct zone *zone) >>> +{ >>> + down_read(_batch_high_lock); >>> + if

Re: [PATCH for v5.9] mm/page_alloc: handle a missing case for memalloc_nocma_{save/restore} APIs

2020-09-25 Thread Vlastimil Babka
On 9/25/20 6:59 AM, Joonsoo Kim wrote: > 2020년 8월 28일 (금) 오전 8:54, Joonsoo Kim 님이 작성: > > Hello, Andrew and Vlastimil. > > It's better to fix this possible bug introduced in v5.9-rc1 before > v5.9 is released. > Which approach do you prefer? > If it is determined, I will immediately send a patch

Re: [PATCH RFC 3/4] mm/page_alloc: always move pages to the tail of the freelist in unset_migratetype_isolate()

2020-09-25 Thread Vlastimil Babka
On 9/25/20 10:05 AM, David Hildenbrand wrote: static inline void del_page_from_free_list(struct page *page, struct zone *zone, unsigned int order) { @@ -2323,7 +2332,7 @@ static inline struct page

Re: [PATCH RFC 0/4] mm: place pages to the freelist tail when onling and undoing isolation

2020-09-24 Thread Vlastimil Babka
On 9/23/20 5:26 PM, David Hildenbrand wrote: > On 23.09.20 16:31, Vlastimil Babka wrote: >> On 9/16/20 9:31 PM, David Hildenbrand wrote: >> > > Hi Vlastimil, > >> I see the point, but I don't think the head/tail mechanism is great for >> this. It &

Re: [PATCH RFC 4/4] mm/page_alloc: place pages to tail in __free_pages_core()

2020-09-24 Thread Vlastimil Babka
t that the new behavior is undesireable for > __free_pages_core() during boot, we can let the caller specify the > behavior. > > Cc: Andrew Morton > Cc: Alexander Duyck > Cc: Mel Gorman > Cc: Michal Hocko > Cc: Dave Hansen > Cc: Vlastimil Babka > Cc: Wei Yang &

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