summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Stoakes (Oracle) <ljs@kernel.org>2026-03-20 21:07:26 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-04-05 23:53:46 +0300
commit1c6b7ff60bd477bb73b737e2955c0ad49cffd7ca (patch)
treeab1e7b02b3f7c3f86bb7c499230eda8b153fc9b1
parent1fc034c1c9dd387f6f82be93326b0add6ffd49e7 (diff)
downloadlinux-1c6b7ff60bd477bb73b737e2955c0ad49cffd7ca.tar.xz
mm/huge_memory: use mm instead of tlb->mm
Reduce the repetition, and lay the ground for further refactorings by keeping this variable separate. Link: https://lkml.kernel.org/r/98104cde87e4b2aabeb16f236b8731591594457f.1774029655.git.ljs@kernel.org Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Reviewed-by: Suren Baghdasaryan <surenb@google.com> Cc: Barry Song <baohua@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Dev Jain <dev.jain@arm.com> Cc: Lance Yang <lance.yang@linux.dev> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Nico Pache <npache@redhat.com> Cc: Qi Zheng <zhengqi.arch@bytedance.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--mm/huge_memory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index d7c1c8f55c13..c515e293ed48 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2415,6 +2415,7 @@ bool zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
pmd_t *pmd, unsigned long addr)
{
bool has_deposit = arch_needs_pgtable_deposit();
+ struct mm_struct *mm = tlb->mm;
struct folio *folio = NULL;
bool flush_needed = false;
spinlock_t *ptl;
@@ -2462,9 +2463,9 @@ bool zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
if (folio_test_anon(folio)) {
has_deposit = true;
- add_mm_counter(tlb->mm, MM_ANONPAGES, -HPAGE_PMD_NR);
+ add_mm_counter(mm, MM_ANONPAGES, -HPAGE_PMD_NR);
} else {
- add_mm_counter(tlb->mm, mm_counter_file(folio),
+ add_mm_counter(mm, mm_counter_file(folio),
-HPAGE_PMD_NR);
/*
@@ -2483,7 +2484,7 @@ bool zap_huge_pmd(struct mmu_gather *tlb, struct vm_area_struct *vma,
out:
if (has_deposit)
- zap_deposited_table(tlb->mm, pmd);
+ zap_deposited_table(mm, pmd);
spin_unlock(ptl);
if (flush_needed)