All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: David Hildenbrand <david@redhat.com>
Cc: yangge1116@126.com, akpm@linux-foundation.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	21cnbao@gmail.com, baolin.wang@linux.alibaba.com,
	muchun.song@linux.dev, liuzixing@hygon.cn
Subject: Re: [PATCH] mm/hugetlb: remove redundant folio_test_hugetlb
Date: Mon, 26 May 2025 15:05:23 +0200	[thread overview]
Message-ID: <aDRnE8B27VgCoJ3N@localhost.localdomain> (raw)
In-Reply-To: <347b3035-26fe-43af-8df4-b1610d305908@redhat.com>

On Mon, May 26, 2025 at 02:23:58PM +0200, David Hildenbrand wrote:
> Already in 6.15, gah.
> 
> Please convert that code to never ever take any hugeglb locks unless we are
> clearly dealing with a hugetlb folios.

I guess we could just do?

 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
 index 20f08de9e37d..8bd8b950e4cb 100644
 --- a/mm/hugetlb.c
 +++ b/mm/hugetlb.c
 @@ -2911,7 +2914,7 @@ int replace_free_hugepage_folios(unsigned long start_pfn, unsigned long end_pfn)
  	while (start_pfn < end_pfn) {
  		folio = pfn_folio(start_pfn);
 
 -		if (!folio_ref_count(folio)) {
 +		if (!folio_ref_count(folio) && folio_test_hugetlb(folio)) {
  			ret = alloc_and_dissolve_hugetlb_folio(folio,
  							       &isolate_list);
  			if (ret)
 
 

-- 
Oscar Salvador
SUSE Labs


  reply	other threads:[~2025-05-26 13:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-23  8:05 [PATCH] mm/hugetlb: remove redundant folio_test_hugetlb yangge1116
2025-05-23  8:23 ` Oscar Salvador
2025-05-23  8:30 ` Muchun Song
2025-05-26 12:20 ` David Hildenbrand
2025-05-26 12:23   ` David Hildenbrand
2025-05-26 13:05     ` Oscar Salvador [this message]
2025-05-26 13:06       ` David Hildenbrand
2025-05-26 13:09         ` Oscar Salvador
2025-05-26 13:10         ` 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=aDRnE8B27VgCoJ3N@localhost.localdomain \
    --to=osalvador@suse.de \
    --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=muchun.song@linux.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.