[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zk_MGmfYsY9dt2Uo@x1n>
Date: Thu, 23 May 2024 19:07:06 -0400
From: Peter Xu <peterx@...hat.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Jason Gunthorpe <jgg@...dia.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Matthew Wilcox <willy@...radead.org>,
Dan Williams <dan.j.williams@...el.com>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Mike Rapoport <rppt@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Michal Hocko <mhocko@...e.com>,
Alex Williamson <alex.williamson@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Borislav Petkov <bp@...en8.de>, x86@...nel.org
Subject: Re: [PATCH RFC 2/2] mm/x86/pat: Do proper PAT bit shift for large
mappings
On Thu, May 23, 2024 at 03:48:22PM -0700, Dave Hansen wrote:
> On 5/23/24 15:37, Peter Xu wrote:
> > diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> > index 317de2afd371..c4a2356b1a54 100644
> > --- a/mm/huge_memory.c
> > +++ b/mm/huge_memory.c
> > @@ -1135,7 +1135,7 @@ static void insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
> > goto out_unlock;
> > }
> >
> > - entry = pmd_mkhuge(pfn_t_pmd(pfn, prot));
> > + entry = pmd_mkhuge(pfn_t_pmd(pfn, pgprot_4k_2_large(prot)));
> > if (pfn_t_devmap(pfn))
> > entry = pmd_mkdevmap(entry);
> > if (write) {
>
> Does this even compile on non-x86 architectures?
Probably not.. I think I can define a pgprot_to_large() globally, pointing
that to pgprot_4k_2_large() on x86 and make the fallback to be noop. And
if there's a new version I'll guarantee to run over my cross compilers.
Any comments on the idea itself? Do we have a problem, or maybe I
overlooked something?
Thanks,
--
Peter Xu
Powered by blists - more mailing lists