linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: Jinjiang Tu <tujinjiang@huawei.com>
Cc: muchun.song@linux.dev, akpm@linux-foundation.org,
	david@redhat.com, linux-mm@kvack.org, wangkefeng.wang@huawei.com
Subject: Re: [PATCH v2] mm/hugetlb: fix set_max_huge_pages() when there are surplus pages
Date: Sun, 6 Apr 2025 12:30:43 +0200	[thread overview]
Message-ID: <Z_JX09MXi97ffHyf@localhost.localdomain> (raw)
In-Reply-To: <Z-_cES01qItUDs_r@localhost.localdomain>

On Fri, Apr 04, 2025 at 03:18:09PM +0200, Oscar Salvador wrote:
>  @@ -3960,7 +3961,12 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid,
>   	 * and won't grow the pool anywhere else. Not until one of the
>   	 * sysctls are changed, or the surplus pages go out of use.
>   	 */
>  -	min_count = h->resv_huge_pages + h->nr_huge_pages - h->free_huge_pages;
>  +	if (h->free_huge_pages > persistent_huge_pages(h))
>  +		substract = h->free_huge_pages - h->surplus_huge_pages;
>  +	else
>  +		h->free_huge_pages;

Ofc, this wanted to be substract = h->free_huge_pages.
 

-- 
Oscar Salvador
SUSE Labs


  reply	other threads:[~2025-04-06 10:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-01  8:23 [PATCH v2] mm/hugetlb: fix set_max_huge_pages() when there are surplus pages Jinjiang Tu
2025-04-03  3:49 ` Andrew Morton
2025-04-03 14:26 ` Oscar Salvador
2025-04-04 13:18   ` Oscar Salvador
2025-04-06 10:30     ` Oscar Salvador [this message]
2025-04-06 10:37       ` Oscar Salvador
2025-04-07  7:26         ` Jinjiang Tu
2025-04-07  7:23     ` Jinjiang Tu
2025-04-07  9:35       ` Oscar Salvador
2025-04-07 10:00         ` Oscar Salvador

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=Z_JX09MXi97ffHyf@localhost.localdomain \
    --to=osalvador@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=muchun.song@linux.dev \
    --cc=tujinjiang@huawei.com \
    --cc=wangkefeng.wang@huawei.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;
as well as URLs for NNTP newsgroup(s).