Messages in this thread | | | Date | Thu, 12 Nov 2020 10:53:58 +0100 | From | Peter Zijlstra <> | 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.
| |