lkml.org 
[lkml]   [2022]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] mm: Merge pte_mkhuge() call into arch_make_huge_pte()
On Wed, Feb 02, 2022 at 06:25:31AM +0000, Christophe Leroy wrote:
>
>
> Le 02/02/2022 à 07:18, Mike Rapoport a écrit :
> > On Wed, Feb 02, 2022 at 11:08:06AM +0530, Anshuman Khandual wrote:
> >> Each call into pte_mkhuge() is invariably followed by arch_make_huge_pte().
> >> Instead arch_make_huge_pte() can accommodate pte_mkhuge() at the beginning.
> >> This updates generic fallback stub for arch_make_huge_pte() and available
> >> platforms definitions. This makes huge pte creation much cleaner and easier
> >> to follow.
> >
> > Won't it break architectures that don't define arch_make_huge_pte()?
>
> It shouldn't, see below

Right, overlooked that.

> >> diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
> >> index d1897a69c540..52c462390aee 100644
> >> --- a/include/linux/hugetlb.h
> >> +++ b/include/linux/hugetlb.h
> >> @@ -754,7 +754,7 @@ static inline void arch_clear_hugepage_flags(struct page *page) { }
> >> static inline pte_t arch_make_huge_pte(pte_t entry, unsigned int shift,
> >> vm_flags_t flags)
> >> {
> >> - return entry;
> >> + return pte_mkhuge(entry);
> >> }
> >> #endif
> >>

--
Sincerely yours,
Mike.

\
 
 \ /
  Last update: 2022-02-02 08:39    [W:0.040 / U:0.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site