From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: David Hildenbrand <david@redhat.com>, Dev Jain <dev.jain@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
<linux-mm@kvack.org>
Cc: Zi Yan <ziy@nvidia.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Ryan Roberts <ryan.roberts@arm.com>,
Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
<Liam.Howlett@oracle.com>,
Sidhartha Kumar <sidhartha.kumar@oracle.com>
Subject: Re: [PATCH v2 3/3] mm: huge_memory: use folio_skip_prot_numa() for pmd folio
Date: Wed, 15 Oct 2025 19:04:22 +0800 [thread overview]
Message-ID: <c5f19802-3d40-4e0e-a9ab-1de64b6869e8@huawei.com> (raw)
In-Reply-To: <77fe5471-ed9a-4448-8a0c-75e41729bec4@redhat.com>
On 2025/10/15 17:54, David Hildenbrand wrote:
> On 15.10.25 11:21, Kefeng Wang wrote:
>>
>>
>> On 2025/10/15 15:30, Dev Jain wrote:
>>>
>>> On 14/10/25 5:03 pm, Kefeng Wang wrote:
>>>> Rename prot_numa_skip() to folio_skip_prot_numa(), and remove
>>>> ret by directly return value instead of goto style.
>>>>
>>>> The folio skip checks for prot numa should be suitable for pmd
>>>> folio too, which helps to avoid unnecessary pmd change and folio
>>>> migration attempts.
>>>>
>>>> Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>
>>> In the review of my mprotect pte batching series, reviewers had
>>> noted that the branch "if (folio_use_access_time(folio))" in
>>> folio_skip_prot_numa() did not belong there - it should be done
>>> outside of the function. But I see that that would duplicate a line
>>> now that this function has two users. So in light of that, would you
>>> mind changing the name of this function to
>>> folio_skip_or_process_prot_numa()?
>>>
>>
>> The name is a bit long, and it only update access_time not change the
>> pte, so maybe we leave it as is?
>
> Any such name might make the return value weird (which indicates whether
> to skip) I'm afraid.
>
> We could invert the meaning and call it something like
>
> folio_apply_prot_numa()
>
> And return whether we have to protect it.
>
> Maybe that's better? Other naming suggestions welcome :)
>
That's better, or folio_needs_prot_numa() as there are already some
similar names with folio_needs_ prefix ?
next prev parent reply other threads:[~2025-10-15 11:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-14 11:33 [PATCH v2 0/3] mm: some optimizations for prot numa Kefeng Wang
2025-10-14 11:33 ` [PATCH v2 1/3] mm: mprotect: always skip dma pinned folio in prot_numa_skip() Kefeng Wang
2025-10-14 22:20 ` Barry Song
2025-10-14 11:33 ` [PATCH v2 2/3] mm: mprotect: avoid unnecessary struct page accessing if pte_protnone() Kefeng Wang
2025-10-14 12:13 ` David Hildenbrand
2025-10-15 7:32 ` Dev Jain
2025-10-15 8:50 ` Kefeng Wang
2025-10-14 11:33 ` [PATCH v2 3/3] mm: huge_memory: use folio_skip_prot_numa() for pmd folio Kefeng Wang
2025-10-15 7:30 ` Dev Jain
2025-10-15 9:21 ` Kefeng Wang
2025-10-15 9:54 ` David Hildenbrand
2025-10-15 11:04 ` Kefeng Wang [this message]
2025-10-15 11:30 ` David Hildenbrand
2025-10-15 12:37 ` 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=c5f19802-3d40-4e0e-a9ab-1de64b6869e8@huawei.com \
--to=wangkefeng.wang@huawei.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=dev.jain@arm.com \
--cc=lance.yang@linux.dev \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=ryan.roberts@arm.com \
--cc=sidhartha.kumar@oracle.com \
--cc=ziy@nvidia.com \
/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