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: Thu, 4 Apr 2024 16:01:18 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Baolin Wang <baolin.wang@...ux.alibaba.com>, akpm@...ux-foundation.org
Cc: mgorman@...hsingularity.net, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: page_alloc: use the correct THP order for THP PCP

On 4/4/24 2:19 PM, Baolin Wang wrote:
> 
> 
> On 2024/4/4 18:03, Vlastimil Babka wrote:
>> On 4/3/24 3:47 PM, Baolin Wang wrote:
>>> Commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored
>>> on the per-cpu lists") extends the PCP allocator to store THP pages, and
>>> it determines whether to cache THP pags in PCP by comparing with pageblock_order.
>>> But the pageblock_order is not always equal to THP order, it might also
>>> be MAX_PAGE_ORDER, which could prevent PCP from caching THP pages.
>>>
>>> Therefore, using HPAGE_PMD_ORDER instead to determine the need for caching
>>> THP for PCP can fix this issue
>>>
>>> Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists")
>>> Signed-off-by: Baolin Wang <baolin.wang@...ux.alibaba.com>
>> 
>> IIUC this happens with CONFIG_HUGETLB_PAGE disabled because HUGETLBFS is
>> disabled? But THPs are still enabled? I think there might be more of THP
> 
> Right, and seems the Powerpc arch will set pageblock_order via 
> set_pageblock_order() when the huge page sizes are variable (not sure if 
> this is always equal to THP order).
> 
> Moreover, it still does not make sense to use pageblock_order to 
> indicate a THP page, especially when we already have HPAGE_PMD_ORDER to 
> represent THP.
> 
>> working suboptimally in that case with pageblock_order being larger
>> (MAX_PAGE_ORDER).
>> 
>> In other words, should be rather make pageblock_order itself defined as
>> 
>>   min_t(unsigned int, HPAGE_PMD_ORDER, MAX_PAGE_ORDER)
>> 
>> in case with !CONFIG_HUGETLB_PAGE but THP enabled.
> 
> Yes, this makes sense to me (I wonder why this wasn't done before?). I 
> can create a seperate patch to do this, what do you think? Thanks.

It probably wasn't anticipated that hugetlbfs would be disabled and THP
enabled. If you can create such patch, great!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ