incoming
Subsystems (11)
Andrew Morton
maintainer10 patches, based on e609571b5ffa3528bf85292de1ceaddac342bc1c.
Subsystems affected by this patch series:
mm/slub
mm/pagealloc
mm/memcg
mm/kasan
mm/vmalloc
mm/migration
mm/hugetlb
MAINTAINERS
mm/memory-failure
mm/process_vm_access
Subsystem: mm/slub
Jann Horn <[email protected]>:
mm, slub: consider rest of partial list if acquire_slab() fails
Subsystem: mm/pagealloc
Hailong liu <[email protected]>:
mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint
Subsystem: mm/memcg
Hugh Dickins <[email protected]>:
mm/memcontrol: fix warning in mem_cgroup_page_lruvec()
Subsystem: mm/kasan
Hailong Liu <[email protected]>:
arm/kasan: fix the array size of kasan_early_shadow_pte[]
Subsystem: mm/vmalloc
Miaohe Lin <[email protected]>:
mm/vmalloc.c: fix potential memory leak
Subsystem: mm/migration
Jan Stancek <[email protected]>:
mm: migrate: initialize err in do_migrate_pages
Subsystem: mm/hugetlb
Miaohe Lin <[email protected]>:
mm/hugetlb: fix potential missing huge page size info
Subsystem: MAINTAINERS
Vlastimil Babka <[email protected]>:
MAINTAINERS: add Vlastimil as slab allocators maintainer
Subsystem: mm/memory-failure
Oscar Salvador <[email protected]>:
mm,hwpoison: fix printing of page flags
Subsystem: mm/process_vm_access
Andrew Morton <[email protected]>:
mm/process_vm_access.c: include compat.h
MAINTAINERS | 1 + include/linux/kasan.h | 6 +++++- include/linux/memcontrol.h | 2 +- mm/hugetlb.c | 2 +- mm/kasan/init.c | 3 ++- mm/memory-failure.c | 2 +- mm/mempolicy.c | 2 +- mm/page_alloc.c | 31 ++++++++++++++++--------------- mm/process_vm_access.c | 1 + mm/slub.c | 2 +- mm/vmalloc.c | 4 +++- 11 files changed, 33 insertions(+), 23 deletions(-)
Andrew Morton
maintainerPATCH 1/10 mm, slub: consider rest of partial list if acquire_slab() fails
From: Jann Horn <[email protected]>
Subject: mm, slub: consider rest of partial list if acquire_slab() fails
acquire_slab() fails if there is contention on the freelist of the page (probably because some other CPU is concurrently freeing an object from the page). In that case, it might make sense to look for a different page (since there might be more remote frees to the page from other CPUs, and we don't want contention on struct page).
However, the current code accidentally stops looking at the partial list completely in that case. Especially on kernels without CONFIG_NUMA set, this means that get_partial() fails and new_slab_objects() falls back to new_slab(), allocating new pages. This could lead to an unnecessary increase in memory fragmentation.
---
mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/slub.c renamed from mm/slub.c~mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails +1 -1
@@ -1973,7 +1973,7 @@ static void *get_partial_node(struct kme t =acquire_slab (s, n, page, object ==NULL , &objects);if (!t) -break ; +continue ;/* cmpxchg raced */ available += objects;if (!object) {
_
Andrew Morton
maintainerPATCH 2/10 mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint
In reply to Andrew MortonFrom: Hailong liu <[email protected]>
Subject: mm/page_alloc: add a missing mm_page_alloc_zone_locked() tracepoint
The trace point *trace_mm_page_alloc_zone_locked()* in __rmqueue() does not currently cover all branches. Add the missing tracepoint and check the page before do that.
---
mm/page_alloc.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~mm-page_alloc-add-a-missing-mm_page_alloc_zone_locked-tracepoint +16 -15
@@ -2862,20 +2862,20 @@ __rmqueue(struct zone *zone, unsigned in {struct page *page; -#ifdef CONFIG_CMA -/* -* Balance movable allocations between regular and CMA areas by -* allocating from CMA when over half of the zone's free memory -* is in the CMA area. -*/ -if (alloc_flags &ALLOC_CMA && -zone_page_state (zone,NR_FREE_CMA_PAGES ) > -zone_page_state (zone,NR_FREE_PAGES ) /2 ) { - page =__rmqueue_cma_fallback (zone, order); -if (page) -return page; +if (IS_ENABLED (CONFIG_CMA )) { +/* +* Balance movable allocations between regular and CMA areas by +* allocating from CMA when over half of the zone's free memory +* is in the CMA area. +*/ +if (alloc_flags &ALLOC_CMA && +zone_page_state (zone,NR_FREE_CMA_PAGES ) > +zone_page_state (zone,NR_FREE_PAGES ) /2 ) { + page =__rmqueue_cma_fallback (zone, order); +if (page) + goto out; + } } -#endif retry: page =__rmqueue_smallest (zone, order, migratetype);if (unlikely (!page)) {
@@ -2886,8 +2886,9 @@ retry: alloc_flags)) goto retry; } - -trace_mm_page_alloc_zone_locked (page, order, migratetype); +out: +if (page) +trace_mm_page_alloc_zone_locked (page, order, migratetype);return page; }
_
Andrew Morton
maintainerPATCH 3/10 mm/memcontrol: fix warning in mem_cgroup_page_lruvec()
In reply to Andrew MortonFrom: Hugh Dickins <[email protected]>
Subject: mm/memcontrol: fix warning in mem_cgroup_page_lruvec()
Boot a CONFIG_MEMCG=y kernel with "cgroup_disabled=memory" and you are met by a series of warnings from the VM_WARN_ON_ONCE_PAGE(!memcg, page) recently added to the inline mem_cgroup_page_lruvec().
An earlier attempt to place that warning, in mem_cgroup_lruvec(), had been careful to do so after weeding out the mem_cgroup_disabled() case; but was itself invalid because of the mem_cgroup_lruvec(NULL, pgdat) in clear_pgdat_congested() and age_active_anon().
Warning in mem_cgroup_page_lruvec() was once useful in detecting a KSM charge bug, so may be worth keeping: but skip if mem_cgroup_disabled().
---
include/linux/memcontrol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/memcontrol.h renamed from include/linux/memcontrol.h~mm-memcontrol-fix-warning-in-mem_cgroup_page_lruvec +1 -1
@@ -665,7 +665,7 @@ static inline struct lruvec *mem_cgroup_ {struct mem_cgroup *memcg =page_memcg (page); -VM_WARN_ON_ONCE_PAGE (!memcg, page); +VM_WARN_ON_ONCE_PAGE (!memcg && !mem_cgroup_disabled (), page);return mem_cgroup_lruvec (memcg, pgdat); }
_
Andrew Morton
maintainerPATCH 4/10 arm/kasan: fix the array size of kasan_early_shadow_pte[]
In reply to Andrew MortonFrom: Hailong Liu <[email protected]>
Subject: arm/kasan: fix the array size of kasan_early_shadow_pte[]
The size of kasan_early_shadow_pte[] now is PTRS_PER_PTE which defined to 512 for arm architecture. This means that it only covers the prev Linux pte entries, but not the HWTABLE pte entries for arm.
The reason it works well current is that the symbol kasan_early_shadow_page immediately following kasan_early_shadow_pte in memory is page aligned, which makes kasan_early_shadow_pte look like a 4KB size array. But we can't ensure the order always right with different compiler/linker, nor more bss symbols be introduced.
We had a test with QEMU + vexpress:put a 512KB-size symbol with attribute __section(".bss..page_aligned") after kasan_early_shadow_pte, and poison it after kasan_early_init(). Then enabled CONFIG_KASAN, it failed to boot up.
---
include/linux/kasan.h | 6 +++++- mm/kasan/init.c | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-)
include/linux/kasan.h renamed from include/linux/kasan.h~arm-kasan-fix-the-arry-size-of-kasan_early_shadow_pte +5 -1
@@ -35,8 +35,12 @@ struct kunit_kasan_expectation {#define KASAN_SHADOW_INIT 0#endif +#ifndef PTE_HWTABLE_PTRS +#define PTE_HWTABLE_PTRS 0 +#endif +extern unsigned char kasan_early_shadow_page[PAGE_SIZE ]; -extern pte_t kasan_early_shadow_pte[PTRS_PER_PTE ]; +extern pte_t kasan_early_shadow_pte[PTRS_PER_PTE +PTE_HWTABLE_PTRS ];extern pmd_t kasan_early_shadow_pmd[PTRS_PER_PMD ];extern pud_t kasan_early_shadow_pud[PTRS_PER_PUD ];extern p4d_t kasan_early_shadow_p4d[MAX_PTRS_PER_P4D ];
mm/kasan/init.c renamed from mm/kasan/init.c~arm-kasan-fix-the-arry-size-of-kasan_early_shadow_pte +2 -1
@@ -64,7 +64,8 @@ static inline bool kasan_pmd_table(pud_treturn false; }#endif -pte_t kasan_early_shadow_pte[PTRS_PER_PTE] __page_aligned_bss; +pte_t kasan_early_shadow_pte[PTRS_PER_PTE + PTE_HWTABLE_PTRS] + __page_aligned_bss;static inline bool kasan_pte_table (pmd_t pmd) {
_
Andrew Morton
maintainerPATCH 5/10 mm/vmalloc.c: fix potential memory leak
In reply to Andrew MortonFrom: Miaohe Lin <[email protected]>
Subject: mm/vmalloc.c: fix potential memory leak
In VM_MAP_PUT_PAGES case, we should put pages and free array in vfree. But we missed to set area->nr_pages in vmap(). So we would failed to put pages in __vunmap() because area->nr_pages = 0.
---
mm/vmalloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
mm/vmalloc.c renamed from mm/vmalloc.c~mm-vmallocc-fix-potential-memory-leak +3 -1
@@ -2420,8 +2420,10 @@ void *vmap(struct page **pages, unsignedreturn NULL ; } -if (flags &VM_MAP_PUT_PAGES ) +if (flags &VM_MAP_PUT_PAGES ) { area->pages = pages; + area->nr_pages = count; + }return area->addr; }EXPORT_SYMBOL (vmap);
_
Andrew Morton
maintainerPATCH 6/10 mm: migrate: initialize err in do_migrate_pages
In reply to Andrew MortonFrom: Jan Stancek <[email protected]>
Subject: mm: migrate: initialize err in do_migrate_pages
After commit 236c32eb1096 ("mm: migrate: clean up migrate_prep{_local}")', do_migrate_pages can return uninitialized variable 'err' (which is propagated to user-space as error) when 'from' and 'to' nodesets are identical. This can be reproduced with LTP migrate_pages01, which calls migrate_pages() with same set for both old/new_nodes.
Add 'err' initialization back.
---
mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mempolicy.c renamed from mm/mempolicy.c~mm-migrate-initialize-err-in-do_migrate_pages +1 -1
@@ -1111,7 +1111,7 @@ int do_migrate_pages(struct mm_struct *m const nodemask_t *to, int flags) { int busy = 0; -int err; +int err =0 ;nodemask_t tmp;migrate_prep ();
_
Andrew Morton
maintainerPATCH 7/10 mm/hugetlb: fix potential missing huge page size info
In reply to Andrew MortonFrom: Miaohe Lin <[email protected]>
Subject: mm/hugetlb: fix potential missing huge page size info
The huge page size is encoded for VM_FAULT_HWPOISON errors only. So if we return VM_FAULT_HWPOISON, huge page size would just be ignored.
---
mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/hugetlb.c renamed from mm/hugetlb.c~mm-hugetlb-fix-potential-missing-huge-page-size-info +1 -1
@@ -4371,7 +4371,7 @@ retry:* So we need to block hugepage fault by PG_hwpoison bit check. */ if (unlikely (PageHWPoison (page))) { - ret =VM_FAULT_HWPOISON | + ret =VM_FAULT_HWPOISON_LARGE |VM_FAULT_SET_HINDEX (hstate_index (h)); goto backout_unlocked; }
_
Andrew Morton
maintainerPATCH 8/10 MAINTAINERS: add Vlastimil as slab allocators maintainer
In reply to Andrew MortonFrom: Vlastimil Babka <[email protected]>
Subject: MAINTAINERS: add Vlastimil as slab allocators maintainer
I would like to help with slab allocators maintenance, from the perspective of being responsible for SLAB and more recently also SLUB in an enterprise distro kernel and supporting its users. Recently I've been focusing on improving SLUB's debugging features, and patch review in the area, including the kmemcg accounting rewrite last year.
---
MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS renamed from MAINTAINERS~maintainers-add-myself-as-slab-allocators-maintainer +1 -0
@@ -16319,6 +16319,7 @@ M: Pekka Enberg <[email protected]> M: David Rientjes <[email protected]> M: Joonsoo Kim <[email protected]> M: Andrew Morton <[email protected]> +M: Vlastimil Babka <[email protected]> L: [email protected] S: Maintained F: include/linux/sl?b*.h
_
Andrew Morton
maintainerPATCH 9/10 mm,hwpoison: fix printing of page flags
In reply to Andrew MortonFrom: Oscar Salvador <[email protected]>
Subject: mm,hwpoison: fix printing of page flags
Format %pG expects a lower case 'p' in order to print the flags. Fix it.
---
mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory-failure.c renamed from mm/memory-failure.c~mmhwpoison-fix-printing-of-page-flags +1 -1
@@ -1940,7 +1940,7 @@ retry: goto retry; } }else if (ret == -EIO ) { -pr_info ("%s: %#lx: unknown page type: %lx (%pGP)\n" , +pr_info ("%s: %#lx: unknown page type: %lx (%pGp)\n" , __func__, pfn, page->flags, &page->flags); }
_
Andrew Morton
maintainerPATCH 10/10 mm/process_vm_access.c: include compat.h
In reply to Andrew MortonFrom: Andrew Morton <[email protected]>
Subject: mm/process_vm_access.c: include compat.h
mm/process_vm_access.c:277:5: error: implicit declaration of function 'in_compat_syscall'; did you mean 'in_ia32_syscall'? [-Werror=implicit-function-declaration]
---
mm/process_vm_access.c | 1 + 1 file changed, 1 insertion(+)
mm/process_vm_access.c renamed from mm/process_vm_access.c~mm-process_vm_accessc-include-compath +1 -0
@@ -9,6 +9,7 @@#include <linux/mm.h> #include <linux/uio.h> #include <linux/sched.h> +#include <linux/compat.h> #include <linux/sched/mm.h> #include <linux/highmem.h> #include <linux/ptrace.h>
_
Quoted 2 lines · Andrew Morton
10 patches, based on
e609571b5ffa3528bf85292de1ceaddac342bc1c.
Whee. I had completely dropped the ball on this - I had built my usual "akpm" branch with the patches, but then had completely forgotten about it after doing my basic build tests.
I tend to leave it for a while to see if people send belated ACK/NAK's for the patches, but that "for a while" is typically "overnight", not several days.
So if you ever notice that I haven't merged your patch submission, and you haven't seen me comment on them, feel free to ping me to remind me.
Because it might just have gotten lost in the shuffle for some random reason. Admittedly it's rare - I think this is the first time I just randomly noticed three days later that I'd never done the actual merge of the patch-series).
Linus