From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Usama Arif <usamaarif642@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
david@redhat.com, linux-mm@kvack.org, ziy@nvidia.com,
baolin.wang@linux.alibaba.com, Liam.Howlett@oracle.com,
npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com,
baohua@kernel.org, kernel-team@meta.com
Subject: Re: [PATCH] mm/huge_memory: remove enforce_sysfs from __thp_vma_allowable_orders
Date: Thu, 21 Aug 2025 16:33:42 +0100 [thread overview]
Message-ID: <f40f4918-77b9-4be7-b09f-429040bfcc4e@lucifer.local> (raw)
In-Reply-To: <20250821150038.2025521-1-usamaarif642@gmail.com>
On Thu, Aug 21, 2025 at 04:00:38PM +0100, Usama Arif wrote:
> Using forced_collapse directly is clearer and enforce_sysfs is not
> really needed.
NIT, but would prefer a little more detail here e.g.:
mm/huge_memory: rename variable for clarity
There's no need to define a new local variable in
__thp_vma_allowable_orders(), it's simply clearer to use the
existing forced_collapse value to determine whether to force a
collapse.
>
> Signed-off-by: Usama Arif <usamaarif642@gmail.com>
LGTM, so:
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> ---
> This was agreed upon in [1]
> [1] https://lore.kernel.org/all/cd99f0f2-260d-4494-bbf6-99daec3e0683@gmail.com/
> ---
> mm/huge_memory.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 6fd714bd04844..5220dbc9fcb31 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -105,7 +105,6 @@ unsigned long __thp_vma_allowable_orders(struct vm_area_struct *vma,
> const bool smaps = type == TVA_SMAPS;
> const bool in_pf = type == TVA_PAGEFAULT;
> const bool forced_collapse = type == TVA_FORCED_COLLAPSE;
> - const bool enforce_sysfs = !forced_collapse;
> unsigned long supported_orders;
>
> /* Check the intersection of requested and supported orders. */
> @@ -168,14 +167,14 @@ unsigned long __thp_vma_allowable_orders(struct vm_area_struct *vma,
> if (!in_pf && shmem_file(vma->vm_file))
> return orders & shmem_allowable_huge_orders(file_inode(vma->vm_file),
> vma, vma->vm_pgoff, 0,
> - !enforce_sysfs);
> + forced_collapse);
>
> if (!vma_is_anonymous(vma)) {
> /*
> - * Enforce sysfs THP requirements as necessary. Anonymous vmas
> + * Enforce THP collapse requirements as necessary. Anonymous vmas
> * were already handled in thp_vma_allowable_orders().
> */
> - if (enforce_sysfs &&
> + if (!forced_collapse &&
> (!hugepage_global_enabled() || (!(vm_flags & VM_HUGEPAGE) &&
> !hugepage_global_always())))
> return 0;
> --
> 2.47.3
>
>
next prev parent reply other threads:[~2025-08-21 15:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 15:00 Usama Arif
2025-08-21 15:26 ` Zi Yan
2025-08-21 15:33 ` Lorenzo Stoakes [this message]
2025-08-21 15:35 ` Dev Jain
2025-08-21 16:19 ` David Hildenbrand
2025-08-21 16:51 ` SeongJae Park
2025-08-22 3:46 ` Baolin 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=f40f4918-77b9-4be7-b09f-429040bfcc4e@lucifer.local \
--to=lorenzo.stoakes@oracle.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=kernel-team@meta.com \
--cc=linux-mm@kvack.org \
--cc=npache@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=usamaarif642@gmail.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