[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201112095358.GU2628@hirez.programming.kicks-ass.net>
Date: Thu, 12 Nov 2020 10:53:58 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Matthew Wilcox <willy@...radead.org>
Cc: "Liang, Kan" <kan.liang@...ux.intel.com>,
Will Deacon <will@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>, mingo@...hat.com,
acme@...nel.org, linux-kernel@...r.kernel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...hat.com, eranian@...gle.com, ak@...ux.intel.com,
dave.hansen@...el.com, kirill.shutemov@...ux.intel.com,
benh@...nel.crashing.org, paulus@...ba.org,
David Miller <davem@...emloft.net>, vbabka@...e.cz
Subject: Re: [PATCH V9 1/4] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE
On Wed, Nov 11, 2020 at 10:33:44PM +0000, Matthew Wilcox wrote:
> On Wed, Nov 11, 2020 at 09:00:00PM +0100, Peter Zijlstra wrote:
> > On Wed, Nov 11, 2020 at 06:26:20PM +0000, Matthew Wilcox wrote:
> > > On Wed, Nov 11, 2020 at 06:22:53PM +0100, Peter Zijlstra wrote:
> > > > On Wed, Nov 11, 2020 at 04:38:48PM +0000, Matthew Wilcox wrote:
> > > > > if (pud_leaf(pud))
> > > > > return PUD_SIZE;
> > > >
> > > > But that doesn't handle non-pagetable aligned hugetlb sizes. Granted,
> > > > that's unlikely at the PUD level, but why be inconsistent..
> > > >
> > > > So we really want:
> > > >
> > > > if (p*d_leaf(p*d)) {
> > > > if (!'special') {
> > > > page = p*d_page(p*d);
> > > > if (PageHuge(page))
> > > > return page_size(compound_head(page));
> > > > }
> > > > return P*D_SIZE;
> > > > }
> > >
> > > Still doesn't work because pages can be mapped at funny offsets.
> >
> > Wait, what?! Is there hardware that has unaligned TLB page-sizes?
>
> No, you can force a 2MB page to be mapped at an address which isn't
> 2MB aligned.
But not a HugeTLB page; AFAICT mmap() will reject if you try and mmap a
hugetlb page out of alignment. So what I wrote above is still valid. If
PageHuge() we can be certain it is aligned properly and using a matching
hardware page size.
You just don't like it because you want me to be purely page-table
based.
Powered by blists - more mailing lists