linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Oscar Salvador <osalvador@suse.de>
To: Jinjiang Tu <tujinjiang@huawei.com>
Cc: david@redhat.com, akpm@linux-foundation.org,
	nao.horiguchi@gmail.com, zi.yan@cs.rutgers.edu,
	linux-mm@kvack.org, wangkefeng.wang@huawei.com,
	sunnanyong@huawei.com
Subject: Re: [PATCH] mm/memory_hotplug: fix call folio_test_large with tail page in do_migrate_range
Date: Fri, 28 Mar 2025 14:23:20 +0100	[thread overview]
Message-ID: <Z-aiyAjwkvMmbVE9@localhost.localdomain> (raw)
In-Reply-To: <20250324131750.1551884-1-tujinjiang@huawei.com>

On Mon, Mar 24, 2025 at 09:17:50PM +0800, Jinjiang Tu wrote:
> We triggered the below BUG:
> 
... 
> When allocating a hugetlb folio, between the folio is taken from buddy
> and prep_compound_page() is called, start_isolate_page_range() and
> do_migrate_range() is called. When do_migrate_range() scans the head page
> of the hugetlb folio, the compound_head field isn't set, so scans the
> tail page next. And at this time, the compound_head field of tail page is
> set, folio_test_large() is called by tail page, thus triggers VM_BUG_ON().
> 
> To fix it, get folio refcount before calling folio_test_large().
> 
> Fixes: 8135d8926c08 ("mm: memory_hotplug: memory hotremove supports thp migration")
> Signed-off-by: Jinjiang Tu <tujinjiang@huawei.com>

Acked-by: Oscar Salvador <osalvador@suse.de>

As David mentions, I think too that this was introduced in
commit: b62b51d2d1593e65 ("mm: memory_hotplug: remove head variable in
do_migrate_range()")


-- 
Oscar Salvador
SUSE Labs


      parent reply	other threads:[~2025-03-28 13:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24 13:17 [PATCH] mm/memory_hotplug: fix call folio_test_large with tail page in do_migrate_range Jinjiang Tu
2025-03-24 13:44 ` David Hildenbrand
2025-03-25  3:02   ` Jinjiang Tu
2025-03-25 13:18     ` Oscar Salvador
2025-03-25 19:05     ` David Hildenbrand
2025-03-26  2:40       ` Jinjiang Tu
2025-03-26 12:53         ` David Hildenbrand
2025-03-27 11:19           ` Jinjiang Tu
2025-03-28 23:37       ` Andrew Morton
2025-04-01 16:44         ` David Hildenbrand
2025-04-07  1:59           ` Andrew Morton
2025-04-07  7:07             ` David Hildenbrand
2025-03-28 13:23 ` Oscar Salvador [this message]

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-aiyAjwkvMmbVE9@localhost.localdomain \
    --to=osalvador@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=nao.horiguchi@gmail.com \
    --cc=sunnanyong@huawei.com \
    --cc=tujinjiang@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=zi.yan@cs.rutgers.edu \
    /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).