* [to-be-updated] mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix.patch removed from -mm tree
@ 2026-08-08 16:58 Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2026-08-08 16:58 UTC (permalink / raw)
To: mm-commits, xueyuan.chen21, will, urezki, ryan.roberts, rppt,
leo.yan, jiangwen6, dev.jain, david, catalin.marinas, baohua,
anshuman.khandual, ajd, jiangwenxiaomi, akpm
The quilt patch titled
Subject: mm/vmalloc: simplify vmap batching helper and limit scan by PFN alignment
has been removed from the -mm tree. Its filename was
mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix.patch
This patch was dropped because an updated version will be issued
------------------------------------------------------
From: Wen Jiang <jiangwenxiaomi@gmail.com>
Subject: mm/vmalloc: simplify vmap batching helper and limit scan by PFN alignment
Date: Wed, 22 Jul 2026 16:58:41 +0800
Pass the current page pointer directly to the batching helper, and limit
the contiguous scan by PFN alignment before checking for a batch size.
This keeps the helper interface simpler and avoids scanning more pages
than can actually be mapped together.
Link: https://lore.kernel.org/20260722085841.3047673-1-jiangwen6@xiaomi.com
Signed-off-by: Wen Jiang <jiangwen6@xiaomi.com>
Suggested-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Andrew Donnellan <ajd@linux.ibm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: "Barry Song (Xiaomi)" <baohua@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xueyuan Chen <xueyuan.chen21@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/vmalloc.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
--- a/mm/vmalloc.c~mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix
+++ a/mm/vmalloc.c
@@ -3585,7 +3585,7 @@ static inline unsigned int vm_shift(pgpr
}
static inline int get_vmap_batch_order(struct page **pages,
- pgprot_t prot, unsigned int max_steps, unsigned int idx)
+ pgprot_t prot, unsigned int nr_pages)
{
unsigned long pfn;
unsigned int nr_contig;
@@ -3594,16 +3594,16 @@ static inline int get_vmap_batch_order(s
if (!IS_ENABLED(CONFIG_HAVE_ARCH_HUGE_VMAP))
return 0;
- nr_contig = num_pages_contiguous(&pages[idx], max_steps);
+ /* Limit nr_pages by pfn alignment */
+ pfn = page_to_pfn(*pages);
+ if (pfn > 0)
+ nr_pages = min_t(unsigned int, nr_pages, 1UL << __ffs(pfn));
+
+ nr_contig = num_pages_contiguous(pages, nr_pages);
if (nr_contig < 2)
return 0;
order = ilog2(nr_contig);
- pfn = page_to_pfn(pages[idx]);
-
- /* Limit order by pfn alignment */
- if (pfn > 0)
- order = min_t(int, order, __ffs(pfn));
if (vm_shift(prot, PAGE_SIZE << order) == PAGE_SHIFT)
return 0;
@@ -3614,8 +3614,8 @@ static inline int get_vmap_batch_order(s
static int vmap_pages_range_batched(unsigned long addr, unsigned long end,
pgprot_t prot, struct page **pages)
{
- unsigned int count = (end - addr) >> PAGE_SHIFT;
- unsigned int prev_shift = 0, idx = 0;
+ const unsigned int nr_pages = (end - addr) >> PAGE_SHIFT;
+ unsigned int prev_shift = 0, batch_start = 0;
unsigned long map_addr = addr, batch_end = addr;
int err;
@@ -3624,26 +3624,26 @@ static int vmap_pages_range_batched(unsi
if (err)
goto out;
- for (unsigned int i = 0; i < count; ) {
+ for (unsigned int i = 0; i < nr_pages; ) {
unsigned int shift = PAGE_SHIFT +
- get_vmap_batch_order(pages, prot, count - i, i);
+ get_vmap_batch_order(pages + i, prot, nr_pages - i);
if (!i)
prev_shift = shift;
if (shift != prev_shift) {
err = vmap_pages_range_noflush_walk(map_addr, batch_end,
- prot, pages + idx, prev_shift);
+ prot, pages + batch_start, prev_shift);
if (err)
goto out;
prev_shift = shift;
map_addr = batch_end;
- idx = i;
+ batch_start = i;
}
/*
- * Once small pages are encountered, the remaining pages
- * are likely small as well.
+ * Once we fail to batch pages, we expect to fail batching
+ * for all remaining pages, so just give up.
*/
if (shift == PAGE_SHIFT)
break;
@@ -3654,8 +3654,8 @@ static int vmap_pages_range_batched(unsi
/* Remaining */
if (map_addr < end)
- err = vmap_pages_range_noflush_walk(map_addr, end,
- prot, pages + idx, prev_shift);
+ err = vmap_pages_range_noflush_walk(map_addr, end, prot,
+ pages + batch_start, prev_shift);
out:
flush_cache_vmap(addr, end);
_
Patches currently in -mm which might be from jiangwenxiaomi@gmail.com are
^ permalink raw reply [flat|nested] 2+ messages in thread* [to-be-updated] mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix.patch removed from -mm tree
@ 2026-07-05 20:36 Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2026-07-05 20:36 UTC (permalink / raw)
To: mm-commits, akpm, akpm
The quilt patch titled
Subject: mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix
has been removed from the -mm tree. Its filename was
mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix.patch
This patch was dropped because an updated version will be issued
------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix
Date: Tue Jun 30 11:35:55 AM PDT 2026
avoid warnings on architectures whose flush_cache_vmap() don't reference
their args
Cc: Andrew Donnellan <ajd@linux.ibm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: "Barry Song (Xiaomi)" <baohua@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Uladzislau Rezki <urezki@gmail.com>
Cc: Wen Jiang <jiangwen6@xiaomi.com>
Cc: Wen Jiang <jiangwenxiaomi@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Xueyuan Chen <xueyuan.chen21@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/vmalloc.c | 1 +
1 file changed, 1 insertion(+)
--- a/mm/vmalloc.c~mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix
+++ a/mm/vmalloc.c
@@ -3629,6 +3629,7 @@ static int vmap_batched(unsigned long ad
prot, pages + idx, prev_shift);
out:
+ (void)start; /* several archs use a macro for flush_cache_vmap() */
flush_cache_vmap(start, end);
return err;
}
_
Patches currently in -mm which might be from akpm@linux-foundation.org are
mm-page_vma_mapped-fix-device-private-pmd-handling-fix.patch
mm-mincore-use-walk_page_range_vma-in-do_mincore-fix.patch
csky-implement-flush_cache_vmap-in-c.patch
mm-page_owner-add-print_mode-filter-fix.patch
mm-annotate-data-race-in-cpu_needs_drain-fix.patch
mm-zsmalloc-encode-class-index-in-obj-value-for-lockless-class-lookup-fix.patch
mm-zsmalloc-drop-pool-lock-from-zs_free-on-64-bit-systems-fix.patch
mm-zsmalloc-drop-pool-lock-from-zs_free-on-64-bit-systems-fix-fix.patch
mm-fix-assert_exclusive_bits-by-passing-memdesc_flags_t-by-pointer-fix.patch
mm-rmap-use-huge_ptep_get-in-try_to_migrate_one-checkpatch-fixes.patch
mm-mprotect-use-huge_ptep_get-for-hugetlb-fix.patch
drivers-media-v4l2-core-v4l2-vp9c-reduce-inlining.patch
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-08 16:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-08 16:58 [to-be-updated] mm-vmalloc-map-contiguous-pages-in-batches-for-vmap-if-possible-fix.patch removed from -mm tree Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2026-07-05 20:36 Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.