Skip to content

Commit 911b2b9

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "9 patches. Subsystems affected by this patch series: mm (migration, highmem, sparsemem, mremap, mempolicy, and memcg), lz4, mailmap, and MAINTAINERS" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: MAINTAINERS: add Tom as clang reviewer mm/list_lru.c: revert "mm/list_lru: optimize memcg_reparent_list_lru_node()" mailmap: update Vasily Averin's email address mm/mempolicy: fix mpol_new leak in shared_policy_replace mmmremap.c: avoid pointless invalidate_range_start/end on mremap(old_size=0) mm/sparsemem: fix 'mem_section' will never be NULL gcc 12 warning lz4: fix LZ4_decompress_safe_partial read out of bound highmem: fix checks in __kmap_local_sched_{in,out} mm: migrate: use thp_order instead of HPAGE_PMD_ORDER for new page allocation.
2 parents 1a3b1bb + 4071a1b commit 911b2b9

File tree

8 files changed

+24
-14
lines changed

8 files changed

+24
-14
lines changed

.mailmap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ Uwe Kleine-König <ukleinek@strlen.de>
391391
Uwe Kleine-König <ukl@pengutronix.de>
392392
Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
393393
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
394+
Vasily Averin <vasily.averin@linux.dev> <vvs@virtuozzo.com>
395+
Vasily Averin <vasily.averin@linux.dev> <vvs@openvz.org>
396+
Vasily Averin <vasily.averin@linux.dev> <vvs@parallels.com>
397+
Vasily Averin <vasily.averin@linux.dev> <vvs@sw.ru>
394398
Vinod Koul <vkoul@kernel.org> <vinod.koul@intel.com>
395399
Vinod Koul <vkoul@kernel.org> <vinod.koul@linux.intel.com>
396400
Vinod Koul <vkoul@kernel.org> <vkoul@infradead.org>

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4791,6 +4791,7 @@ F: .clang-format
47914791
CLANG/LLVM BUILD SUPPORT
47924792
M: Nathan Chancellor <nathan@kernel.org>
47934793
M: Nick Desaulniers <ndesaulniers@google.com>
4794+
R: Tom Rix <trix@redhat.com>
47944795
L: llvm@lists.linux.dev
47954796
S: Supported
47964797
W: https://clangbuiltlinux.github.io/

include/linux/mmzone.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,13 +1397,16 @@ static inline unsigned long *section_to_usemap(struct mem_section *ms)
13971397

13981398
static inline struct mem_section *__nr_to_section(unsigned long nr)
13991399
{
1400+
unsigned long root = SECTION_NR_TO_ROOT(nr);
1401+
1402+
if (unlikely(root >= NR_SECTION_ROOTS))
1403+
return NULL;
1404+
14001405
#ifdef CONFIG_SPARSEMEM_EXTREME
1401-
if (!mem_section)
1406+
if (!mem_section || !mem_section[root])
14021407
return NULL;
14031408
#endif
1404-
if (!mem_section[SECTION_NR_TO_ROOT(nr)])
1405-
return NULL;
1406-
return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK];
1409+
return &mem_section[root][nr & SECTION_ROOT_MASK];
14071410
}
14081411
extern size_t mem_section_usage_size(void);
14091412

lib/lz4/lz4_decompress.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,12 @@ static FORCE_INLINE int LZ4_decompress_generic(
271271
ip += length;
272272
op += length;
273273

274-
/* Necessarily EOF, due to parsing restrictions */
275-
if (!partialDecoding || (cpy == oend))
274+
/* Necessarily EOF when !partialDecoding.
275+
* When partialDecoding, it is EOF if we've either
276+
* filled the output buffer or
277+
* can't proceed with reading an offset for following match.
278+
*/
279+
if (!partialDecoding || (cpy == oend) || (ip >= (iend - 2)))
276280
break;
277281
} else {
278282
/* may overwrite up to WILDCOPYLENGTH beyond cpy */

mm/highmem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ void __kmap_local_sched_out(void)
624624

625625
/* With debug all even slots are unmapped and act as guard */
626626
if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL) && !(i & 0x01)) {
627-
WARN_ON_ONCE(!pte_none(pteval));
627+
WARN_ON_ONCE(pte_val(pteval) != 0);
628628
continue;
629629
}
630630
if (WARN_ON_ONCE(pte_none(pteval)))
@@ -661,7 +661,7 @@ void __kmap_local_sched_in(void)
661661

662662
/* With debug all even slots are unmapped and act as guard */
663663
if (IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL) && !(i & 0x01)) {
664-
WARN_ON_ONCE(!pte_none(pteval));
664+
WARN_ON_ONCE(pte_val(pteval) != 0);
665665
continue;
666666
}
667667
if (WARN_ON_ONCE(pte_none(pteval)))

mm/list_lru.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,6 @@ static void memcg_reparent_list_lru_node(struct list_lru *lru, int nid,
394394
int dst_idx = dst_memcg->kmemcg_id;
395395
struct list_lru_one *src, *dst;
396396

397-
/*
398-
* If there is no lru entry in this nlru, we can skip it immediately.
399-
*/
400-
if (!READ_ONCE(nlru->nr_items))
401-
return;
402-
403397
/*
404398
* Since list_lru_{add,del} may be called under an IRQ-safe lock,
405399
* we have to use IRQ-safe primitives here to avoid deadlock.

mm/mempolicy.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2743,6 +2743,7 @@ static int shared_policy_replace(struct shared_policy *sp, unsigned long start,
27432743
mpol_new = kmem_cache_alloc(policy_cache, GFP_KERNEL);
27442744
if (!mpol_new)
27452745
goto err_out;
2746+
atomic_set(&mpol_new->refcnt, 1);
27462747
goto restart;
27472748
}
27482749

mm/mremap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,9 @@ unsigned long move_page_tables(struct vm_area_struct *vma,
486486
pmd_t *old_pmd, *new_pmd;
487487
pud_t *old_pud, *new_pud;
488488

489+
if (!len)
490+
return 0;
491+
489492
old_end = old_addr + len;
490493
flush_cache_range(vma, old_addr, old_end);
491494

0 commit comments

Comments
 (0)