Thread (50 messages) 50 messages, 11 authors, 2023-05-25

Re: [PATCH 14/23] riscv/hugetlb: pte_alloc_huge() pte_offset_huge()

From: Alexandre Ghiti <alex@ghiti.fr>
Date: 2023-05-10 08:01:37
Also in: linux-m68k, linux-mips, linux-mm, linux-riscv, linux-s390, linux-sh, lkml, sparclinux

Hi Hugh,

On 5/10/23 06:59, Hugh Dickins wrote:
quoted hunk ↗ jump to hunk
pte_alloc_map() expects to be followed by pte_unmap(), but hugetlb omits
that: to keep balance in future, use the recently added pte_alloc_huge()
instead; with pte_offset_huge() a better name for pte_offset_kernel().

Signed-off-by: Hugh Dickins <hughd@google.com>
---
  arch/riscv/mm/hugetlbpage.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/mm/hugetlbpage.c b/arch/riscv/mm/hugetlbpage.c
index a163a3e0f0d4..80926946759f 100644
--- a/arch/riscv/mm/hugetlbpage.c
+++ b/arch/riscv/mm/hugetlbpage.c
@@ -43,7 +43,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm,
  
  	for_each_napot_order(order) {
  		if (napot_cont_size(order) == sz) {
-			pte = pte_alloc_map(mm, pmd, addr & napot_cont_mask(order));
+			pte = pte_alloc_huge(mm, pmd, addr & napot_cont_mask(order));
  			break;
  		}
  	}
@@ -90,7 +90,7 @@ pte_t *huge_pte_offset(struct mm_struct *mm,
  
  	for_each_napot_order(order) {
  		if (napot_cont_size(order) == sz) {
-			pte = pte_offset_kernel(pmd, addr & napot_cont_mask(order));
+			pte = pte_offset_huge(pmd, addr & napot_cont_mask(order));
  			break;
  		}
  	}

Reviewed-by: Alexandre Ghiti <redacted>

Thanks,

Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help