mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joshua Hahn <joshua.hahnjy@gmail.com>
To: Kaitao Cheng <kaitao.cheng@linux.dev>
Cc: Muchun Song <muchun.song@linux.dev>,
	Oscar Salvador <osalvador@suse.de>,
	David Hildenbrand <david@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Kaitao Cheng <chengkaitao@kylinos.cn>,
	Joshua hahn <joshua.hahnjy@gmail.com>
Subject: Re: [PATCH] mm/hugetlb: use hugetlb_vmemmap_optimizable() in boolean contexts
Date: Mon, 24 Aug 2026 09:59:40 -0700	[thread overview]
Message-ID: <20260824165941.2354729-1-joshua.hahnjy@gmail.com> (raw)
In-Reply-To: <20260824151655.30840-1-kaitao.cheng@linux.dev>

On Mon, 24 Aug 2026 23:16:55 +0800 Kaitao Cheng <kaitao.cheng@linux.dev> wrote:

> From: Kaitao Cheng <chengkaitao@kylinos.cn>
> 
> The two boot-time sites in hugetlb_hstate_alloc_pages_onenode() and
> hugetlb_pages_alloc_boot_node() only need to know whether HVO is
> applicable, not the exact optimizable size. Switch them from
> hugetlb_vmemmap_optimizable_size() to hugetlb_vmemmap_optimizable()
> to make intent explicit.

Hi Kaitao, thank you for the patch.

I think the changes look good. hugetlb_vmemmap_optimizable is just a
oneliner that checks hugetlb_vmemmap_optimizable_size != 0 anyways
so this change seems clean with no side effects.

Notably this leaves the only user of hugetlb_vmemmap_optimizable_size
an inittimepr_info statement. Just thought I would note that here.

Have a great day!

Reviewed-by: Joshua hahn <joshua.hahnjy@gmail.com>

> No functional change intended.
> 
> Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
> ---
>  mm/hugetlb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index a03a75fd7fa8..885f721999e6 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -3416,7 +3416,7 @@ static void __init hugetlb_hstate_alloc_pages_onenode(struct hstate *h, int nid)
>  			folio = only_alloc_fresh_hugetlb_folio(h, gfp_mask, nid,
>  					&node_states[N_MEMORY], NULL);
>  			if (!folio && !list_empty(&folio_list) &&
> -			    hugetlb_vmemmap_optimizable_size(h)) {
> +			    hugetlb_vmemmap_optimizable(h)) {
>  				prep_and_add_allocated_folios(h, &folio_list);
>  				INIT_LIST_HEAD(&folio_list);
>  				folio = only_alloc_fresh_hugetlb_folio(h, gfp_mask, nid,
> @@ -3485,7 +3485,7 @@ static void __init hugetlb_pages_alloc_boot_node(unsigned long start, unsigned l
>  	for (i = 0; i < num; ++i) {
>  		struct folio *folio;
>  
> -		if (hugetlb_vmemmap_optimizable_size(h) &&
> +		if (hugetlb_vmemmap_optimizable(h) &&
>  		    (si_mem_available() == 0) && !list_empty(&folio_list)) {
>  			prep_and_add_allocated_folios(h, &folio_list);
>  			INIT_LIST_HEAD(&folio_list);
> -- 
> 2.50.1 (Apple Git-155)
> 
> 

  reply	other threads:[~2026-08-24 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 15:16 Kaitao Cheng
2026-08-24 16:59 ` Joshua Hahn [this message]
2026-08-25  2:05 ` Muchun Song

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=20260824165941.2354729-1-joshua.hahnjy@gmail.com \
    --to=joshua.hahnjy@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengkaitao@kylinos.cn \
    --cc=david@kernel.org \
    --cc=kaitao.cheng@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=osalvador@suse.de \
    /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

all inboxes | Powered by JetHome®