From: Muchun Song <muchun.song@linux.dev>
To: yangge1116@126.com
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, 21cnbao@gmail.com,
david@redhat.com, baolin.wang@linux.alibaba.com,
osalvador@suse.de, liuzixing@hygon.cn
Subject: Re: [PATCH V2] mm/hugetlb: remove unnecessary holding of hugetlb_lock
Date: Wed, 28 May 2025 10:45:07 +0800 [thread overview]
Message-ID: <8112FABF-726A-4C6F-ABE3-D2D917334366@linux.dev> (raw)
In-Reply-To: <1748317010-16272-1-git-send-email-yangge1116@126.com>
> On May 27, 2025, at 11:36, yangge1116@126.com wrote:
>
> From: Ge Yang <yangge1116@126.com>
>
> In the isolate_or_dissolve_huge_folio() function, after acquiring the
> hugetlb_lock, it is only for the purpose of obtaining the correct hstate,
> which is then passed to the alloc_and_dissolve_hugetlb_folio() function.
>
> The alloc_and_dissolve_hugetlb_folio() function itself also acquires the
> hugetlb_lock. We can have the alloc_and_dissolve_hugetlb_folio() function
> obtain the hstate by itself, so that the isolate_or_dissolve_huge_folio()
> function no longer needs to acquire the hugetlb_lock. In addition, we keep
> the folio_test_hugetlb() check within the isolate_or_dissolve_huge_folio()
> function. By doing so, we can avoid disrupting the normal path by vainly
> holding the hugetlb_lock.
>
> The replace_free_hugepage_folios() function has the same issue, and we
> should address it as well.
>
> Suggested-by: Oscar Salvador <osalvador@suse.de>
> Signed-off-by: Ge Yang <yangge1116@126.com>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Thanks.
next prev parent reply other threads:[~2025-05-28 2:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 3:36 [PATCH V2] mm/hugetlb: remove unnecessary holding of hugetlb_lock yangge1116
2025-05-28 2:45 ` Muchun Song [this message]
2025-06-04 22:47 ` Andrew Morton
2025-06-05 0:44 ` Ge Yang
2025-06-06 1:12 ` Andrew Morton
2025-06-06 5:45 ` Ge Yang
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=8112FABF-726A-4C6F-ABE3-D2D917334366@linux.dev \
--to=muchun.song@linux.dev \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuzixing@hygon.cn \
--cc=osalvador@suse.de \
--cc=yangge1116@126.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).