Skip to content

Commit f0d9d79

Browse files
Baolin Wangctmarinas
authored andcommitted
arm64/hugetlb: Use ptep_get() to get the pte value of a huge page
The original huge_ptep_get() on ARM64 is just a wrapper of ptep_get(), which will not take into account any contig-PTEs dirty and access bits. Meanwhile we will implement a new ARM64-specific huge_ptep_get() interface in following patch, which will take into account any contig-PTEs dirty and access bits. To keep the same efficient logic to get the pte value, change to use ptep_get() as a preparation. Signed-off-by: Baolin Wang <[email protected]> Reviewed-by: Muchun Song <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/5113ed6e103f995e1d0f0c9fda0373b761bbcad2.1652496622.git.baolin.wang@linux.alibaba.com Signed-off-by: Catalin Marinas <[email protected]>
1 parent c733812 commit f0d9d79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

arch/arm64/mm/hugetlbpage.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ static pte_t get_clear_contig(struct mm_struct *mm,
172172
unsigned long pgsize,
173173
unsigned long ncontig)
174174
{
175-
pte_t orig_pte = huge_ptep_get(ptep);
175+
pte_t orig_pte = ptep_get(ptep);
176176
unsigned long i;
177177

178178
for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) {
@@ -379,7 +379,7 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
379379
{
380380
int ncontig;
381381
size_t pgsize;
382-
pte_t orig_pte = huge_ptep_get(ptep);
382+
pte_t orig_pte = ptep_get(ptep);
383383

384384
if (!pte_cont(orig_pte))
385385
return ptep_get_and_clear(mm, addr, ptep);
@@ -402,11 +402,11 @@ static int __cont_access_flags_changed(pte_t *ptep, pte_t pte, int ncontig)
402402
{
403403
int i;
404404

405-
if (pte_write(pte) != pte_write(huge_ptep_get(ptep)))
405+
if (pte_write(pte) != pte_write(ptep_get(ptep)))
406406
return 1;
407407

408408
for (i = 0; i < ncontig; i++) {
409-
pte_t orig_pte = huge_ptep_get(ptep + i);
409+
pte_t orig_pte = ptep_get(ptep + i);
410410

411411
if (pte_dirty(pte) != pte_dirty(orig_pte))
412412
return 1;

0 commit comments

Comments
 (0)