lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Aug 2020 09:39:51 -0400
From:   "Liang, Kan" <kan.liang@...ux.intel.com>
To:     Peter Zijlstra <peterz@...radead.org>,
        Dave Hansen <dave.hansen@...el.com>
Cc:     acme@...nel.org, mingo@...hat.com, linux-kernel@...r.kernel.org,
        mark.rutland@....com, alexander.shishkin@...ux.intel.com,
        jolsa@...hat.com, eranian@...gle.com, ak@...ux.intel.com,
        kirill.shutemov@...ux.intel.com
Subject: Re: [PATCH V6 01/16] perf/core: Add PERF_SAMPLE_DATA_PAGE_SIZE



On 8/10/2020 6:47 PM, Peter Zijlstra wrote:
> On Mon, Aug 10, 2020 at 06:38:35PM -0400, Liang, Kan wrote:
>> On 8/10/2020 5:47 PM, Dave Hansen wrote:
> 
>>> It's probably best if we very carefully define up front what is getting
>>> reported here.  For instance, I believe we already have some fun cases
>>> with huge tmpfs where a compound page is mapped with 4k PTEs.  Kirill
>>> also found a few drivers doing this as well.  I think there were also
>>> some weird cases for ARM hugetlbfs where there were multiple hardware
>>> page table entries mapping a single hugetlbfs page.  These would be
>>> cases where compound_head() size would be greater than the size of the
>>> leaf paging structure entry.
>>>
>>> This is also why we have KerelPageSize and MMUPageSize in /proc/$pid/smaps.
>>>
>>> So, is this returning the kernel software page size or the MMU size?
>>>
>>
>> This tries to return the kernel software page size. I will add a commit to
>> the function. For the above cases, I think they can be detected by
>> PageCompound(page). The current code should already cover them. Is my
>> understanding correct?
> 
> But the rationale for the whole feature was to measure and possibly
> drive large page promotion/demotion, which requires the mmu page-size.

Yes, the MMU page-size is better here.

I still have some questions regarding MMUPageSize VS. KerelPageSize.
Could you please clarify?

I checked the show_smap code in fs/proc/task_mmu.c. We defined a __weak 
function for vma_mmu_pagesize(), which invokes vma_kernel_pagesize(). 
The comments also say that "In the majority of cases, the page size used 
by the kernel matches the MMU size. On architectures where it differs, 
an architecture-specific 'strong' version of this symbol is required."
I searched the vma_mmu_pagesize(). It seems that PowerPC is the only one 
that defines a 'strong' function. In other words, the MMUPageSize and 
KerelPageSize are the same for X86. However, it seems not true for the 
above compound page cases. Is it a bug for smaps? Or am I missed anything?

Thanks,
Kan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ