mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
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>
This commit is contained in:
parent
1fc034c1c9
commit
1c6b7ff60b
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user