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, 11 Nov 2020 15:30:22 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Peter Zijlstra <peterz@...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 01:43:57PM +0100, Peter Zijlstra wrote:
> +	if (pud_leaf(pud)) {
>  #ifdef pud_page
> -		page = pud_page(*pud);
> -		if (PageHuge(page))
> -			return page_size(compound_head(page));
> +		if (!pud_devmap(pud)) {
> +			page = pud_page(pud);
> +			if (PageHuge(page))
> +				return page_size(compound_head(page));
> +		}
>  #endif
>  		return 1ULL << PUD_SHIFT;

This confuses me.  Why only special-case hugetlbfs pages here?  Should
they really be treated differently from THP?  If you want to consider
that we might be mapping a page that's twice as big as a PUD entry and
this is only half of it, then the simple way is:

	if (pud_leaf(pud)) {
#ifdef pud_page
		page = compound_head(pud_page(*pud));
		return page_size(page);
#else
		return 1ULL << PUD_SHIFT;
#endif
	}

Also, what's up with the special-casing of devmap pages here?  Did the
devmap people fuck up their compound pages?  If so, they should fix their
shit, not expect the rest of the kernel to work around this brokenness.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ