@@ -166,15 +166,14 @@ static inline int num_contig_ptes(unsigned long size, size_t *pgsize)
166
166
*
167
167
* This helper performs the break step.
168
168
*/
169
- static pte_t get_clear_flush (struct mm_struct * mm ,
169
+ static pte_t get_clear_contig (struct mm_struct * mm ,
170
170
unsigned long addr ,
171
171
pte_t * ptep ,
172
172
unsigned long pgsize ,
173
173
unsigned long ncontig )
174
174
{
175
175
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 ;
178
177
179
178
for (i = 0 ; i < ncontig ; i ++ , addr += pgsize , ptep ++ ) {
180
179
pte_t pte = ptep_get_and_clear (mm , addr , ptep );
@@ -190,11 +189,6 @@ static pte_t get_clear_flush(struct mm_struct *mm,
190
189
if (pte_young (pte ))
191
190
orig_pte = pte_mkyoung (orig_pte );
192
191
}
193
-
194
- if (valid ) {
195
- struct vm_area_struct vma = TLB_FLUSH_VMA (mm , 0 );
196
- flush_tlb_range (& vma , saddr , addr );
197
- }
198
192
return orig_pte ;
199
193
}
200
194
@@ -392,7 +386,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
392
386
393
387
ncontig = find_num_contig (mm , addr , ptep , & pgsize );
394
388
395
- return get_clear_flush (mm , addr , ptep , pgsize , ncontig );
389
+ return get_clear_contig (mm , addr , ptep , pgsize , ncontig );
396
390
}
397
391
398
392
/*
@@ -443,7 +437,7 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
443
437
if (!__cont_access_flags_changed (ptep , pte , ncontig ))
444
438
return 0 ;
445
439
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 );
447
441
448
442
/* Make sure we don't lose the dirty or young state */
449
443
if (pte_dirty (orig_pte ))
@@ -476,7 +470,7 @@ void huge_ptep_set_wrprotect(struct mm_struct *mm,
476
470
ncontig = find_num_contig (mm , addr , ptep , & pgsize );
477
471
dpfn = pgsize >> PAGE_SHIFT ;
478
472
479
- pte = get_clear_flush (mm , addr , ptep , pgsize , ncontig );
473
+ pte = get_clear_contig (mm , addr , ptep , pgsize , ncontig );
480
474
pte = pte_wrprotect (pte );
481
475
482
476
hugeprot = pte_pgprot (pte );
0 commit comments