mm-memory-simplify-calculation-in-unmap_mapping_range_tree.patch removed from -mm tree
The quilt patch titled
Subject: mm/memory: simplify calculation in unmap_mapping_range_tree()
has been removed from the -mm tree. Its filename was
mm-memory-simplify-calculation-in-unmap_mapping_range_tree.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: "David Hildenbrand (Arm)" <[email protected]>
Subject: mm/memory: simplify calculation in unmap_mapping_range_tree()
Date: Fri, 27 Feb 2026 21:08:35 +0100
Let's simplify the calculation a bit further to make it easier to get, reusing vma_last_pgoff() which we move from interval_tree.c to mm.h.
---
include/linux/mm.h | 5 +++++ mm/interval_tree.c | 5 ----- mm/memory.c | 12 +++++------- 3 files changed, 10 insertions(+), 12 deletions(-)
include/linux/mm.h renamed from include/linux/mm.h~mm-memory-simplify-calculation-in-unmap_mapping_range_tree +5 -0
@@ -3969,6 +3969,11 @@ static inline unsigned long vma_pages(coreturn (vma->vm_end - vma->vm_start) >>PAGE_SHIFT ; } +static inline unsigned long vma_last_pgoff (struct vm_area_struct *vma) +{ +return vma->vm_pgoff +vma_pages (vma) -1 ; +} +static inline unsigned long vma_desc_size (const struct vm_area_desc *desc) {return desc->end - desc->start;
mm/interval_tree.c renamed from mm/interval_tree.c~mm-memory-simplify-calculation-in-unmap_mapping_range_tree +0 -5
@@ -15,11 +15,6 @@ static inline unsigned long vma_start_pgreturn v->vm_pgoff; } -static inline unsigned long vma_last_pgoff (struct vm_area_struct *v) -{ -return v->vm_pgoff +vma_pages (v) -1 ; -} - INTERVAL_TREE_DEFINE(struct vm_area_struct, shared.rb, unsigned long, shared.rb_subtree_last, vma_start_pgoff, vma_last_pgoff, /* empty */, vma_interval_tree)
mm/memory.c renamed from mm/memory.c~mm-memory-simplify-calculation-in-unmap_mapping_range_tree +5 -7
@@ -4227,17 +4227,15 @@ static inline void unmap_mapping_range_t struct zap_details *details) {struct vm_area_struct *vma; -pgoff_t vba, vea, zba, zea;unsigned long start, size;struct mmu_gather tlb; vma_interval_tree_foreach(vma, root, first_index, last_index) { - vba = vma->vm_pgoff; - vea = vba +vma_pages (vma) -1 ; - zba =max (first_index, vba); - zea =min (last_index, vea); - start = ((zba - vba) <<PAGE_SHIFT ) + vma->vm_start; - size = (zea - zba +1 ) <<PAGE_SHIFT ; +const pgoff_t start_idx =max (first_index, vma->vm_pgoff); +const pgoff_t end_idx =min (last_index,vma_last_pgoff (vma)) +1 ; + + start = vma->vm_start + ((start_idx - vma->vm_pgoff) <<PAGE_SHIFT ); + size = (end_idx - start_idx) <<PAGE_SHIFT ;tlb_gather_mmu (&tlb, vma->vm_mm);zap_page_range_single_batched (&tlb, vma, start, size, details);
_
Patches currently in -mm which might be from [email protected] are