linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Ryan Roberts <ryan.roberts@arm.com>,
	Kefeng Wang <wangkefeng.wang@huawei.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: willy@infradead.org, Barry Song <baohua@kernel.org>,
	Hugh Dickins <hughd@google.com>,
	linux-mm@kvack.org
Subject: Re: [PATCH] mm: set hugepage to false when anon mthp allocation
Date: Wed, 9 Oct 2024 16:28:44 +0200	[thread overview]
Message-ID: <443f9571-37dd-47eb-b8f3-91b4e779bb9e@redhat.com> (raw)
In-Reply-To: <f7eb0eac-d3c1-4c5e-8a70-781e0df11573@arm.com>

On 09.10.24 12:44, Ryan Roberts wrote:
> On 09/10/2024 10:15, Kefeng Wang wrote:
>>
>> On 2024/9/13 18:36, Kefeng Wang wrote:
>>> Hi All,
>>>
>>> On 2024/9/10 22:18, Kefeng Wang wrote:
>>>>
>>>>
>>>> On 2024/9/10 22:06, Kefeng Wang wrote:
>>>>> When the hugepage parameter is true in vma_alloc_folio(), it indicates
>>>>> that we only try allocation on preferred node if possible for PMD_ORDER,
>>>>
>>>> Should remove "for PMD_ORDER", I mean that it was used for PMD_ORDER, but for
>>>> other high-order, it will reduce the success rate of allocation if without
>>>> ddc1a5cbc05d.
>>>>
>>>>
>>>>> but it could lead to lots of failures for large folio allocation,
>>>>> luckily the hugepage parameter was deprecated since commit ddc1a5cbc05d
>>>>> ("mempolicy: alloc_pages_mpol() for NUMA policy without vma"), so no
>>>>> effect on runtime behavior.
>>>>>
>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>>> ---
>>>>>
>>>>> Found the issue when backport mthp to inner kernel without ddc1a5cbc05d,
>>>>> but for mainline, there is no issue, no clue why hugepage parameter was
>>>>> retained, maybe just kill the parameter for mainline?
>>>
>>>
>>> Any comments, fix in alloc_anon_folio() or remove hugepage parameter in
>>> vma_alloc_folio(), thanks.
>>
>> * vma_alloc_folio - Allocate a folio for a VMA.
>> @hugepage: Unused (was: For hugepages try only preferred node if possible).
>>
>> Since hugepage won't be used in vma_alloc_folio(), maybe just delete this
>> parameter?
> 
> Sorry for the radio silence. Given the param is no longer used, I think it would
> be cleaner to just remove it.

Agreed, no dead code.

> 
> It was set to true here on purpose though; the aim was to follow the pattern set
> by PMD-sized THP, which also sets it to true. And the aargument was that the
> benefit of having a huge page would be outstripped by having to access it on a
> remote node.
> 
> Now that the parameter is deprecated, do you know if the policy is still
> enforced by other means?

Right, it might indicate a bug. So figuring out why there are no users 
left would be interesting. Maybe it was all on purpose.

-- 
Cheers,

David / dhildenb



  reply	other threads:[~2024-10-09 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 14:06 Kefeng Wang
2024-09-10 14:18 ` Kefeng Wang
2024-09-13 10:36   ` Kefeng Wang
2024-10-09  9:15     ` Kefeng Wang
2024-10-09 10:44       ` Ryan Roberts
2024-10-09 14:28         ` David Hildenbrand [this message]
2024-10-10  1:13           ` Kefeng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=443f9571-37dd-47eb-b8f3-91b4e779bb9e@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=ryan.roberts@arm.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox