Skip to content

Commit fb396bb

Browse files
Anshuman Khandualctmarinas
authored andcommitted
arm64/hugetlb: Drop TLB flush from get_clear_flush()
This drops now redundant TLB flush in get_clear_flush() which is no longer required after recent commit 697a1d4 ("tlb: hugetlb: Add more sizes to tlb_remove_huge_tlb_entry"). It also renames this function i.e dropping off '_flush' and replacing it with '__contig' as appropriate. Cc: Will Deacon <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 710c8d6 commit fb396bb

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

arch/arm64/mm/hugetlbpage.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,14 @@ static inline int num_contig_ptes(unsigned long size, size_t *pgsize)
166166
*
167167
* This helper performs the break step.
168168
*/
169-
static pte_t get_clear_flush(struct mm_struct *mm,
169+
static pte_t get_clear_contig(struct mm_struct *mm,
170170
unsigned long addr,
171171
pte_t *ptep,
172172
unsigned long pgsize,
173173
unsigned long ncontig)
174174
{
175175
pte_t orig_pte = huge_ptep_get(ptep);
176-
bool valid = pte_valid(orig_pte);
177-
unsigned long i, saddr = addr;
176+
unsigned long i;
178177

179178
for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) {
180179
pte_t pte = ptep_get_and_clear(mm, addr, ptep);
@@ -190,11 +189,6 @@ static pte_t get_clear_flush(struct mm_struct *mm,
190189
if (pte_young(pte))
191190
orig_pte = pte_mkyoung(orig_pte);
192191
}
193-
194-
if (valid) {
195-
struct vm_area_struct vma = TLB_FLUSH_VMA(mm, 0);
196-
flush_tlb_range(&vma, saddr, addr);
197-
}
198192
return orig_pte;
199193
}
200194

@@ -392,7 +386,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
392386

393387
ncontig = find_num_contig(mm, addr, ptep, &pgsize);
394388

395-
return get_clear_flush(mm, addr, ptep, pgsize, ncontig);
389+
return get_clear_contig(mm, addr, ptep, pgsize, ncontig);
396390
}
397391

398392
/*
@@ -443,7 +437,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
443437
if (!__cont_access_flags_changed(ptep, pte, ncontig))
444438
return 0;
445439

446-
orig_pte = get_clear_flush(vma->vm_mm, addr, ptep, pgsize, ncontig);
440+
orig_pte = get_clear_contig(vma->vm_mm, addr, ptep, pgsize, ncontig);
447441

448442
/* Make sure we don't lose the dirty or young state */
449443
if (pte_dirty(orig_pte))
@@ -476,7 +470,7 @@ void huge_ptep_set_wrprotect(struct mm_struct *mm,
476470
ncontig = find_num_contig(mm, addr, ptep, &pgsize);
477471
dpfn = pgsize >> PAGE_SHIFT;
478472

479-
pte = get_clear_flush(mm, addr, ptep, pgsize, ncontig);
473+
pte = get_clear_contig(mm, addr, ptep, pgsize, ncontig);
480474
pte = pte_wrprotect(pte);
481475

482476
hugeprot = pte_pgprot(pte);

0 commit comments

Comments
 (0)