linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jinjiang Tu <tujinjiang@huawei.com>
To: David Hildenbrand <david@redhat.com>, <akpm@linux-foundation.org>,
	<dev.jain@arm.com>, <catalin.marinas@arm.com>,
	<lorenzo.stoakes@oracle.com>, <thiago.bauermann@linaro.org>,
	<superman.xpt@gmail.com>, <christophe.leroy@csgroup.eu>,
	<brahmajit.xyz@gmail.com>, <andrii@kernel.org>,
	<avagin@gmail.com>, <baolin.wang@linux.alibaba.com>,
	<ryan.roberts@arm.com>, <hughd@google.com>, <rientjes@google.com>,
	<mhocko@suse.com>, <joern@logfs.org>
Cc: <linux-mm@kvack.org>, <wangkefeng.wang@huawei.com>
Subject: Re: [PATCH v2 0/3] hold PTL for several .hugetlb_entry callbacks
Date: Fri, 25 Jul 2025 10:02:04 +0800	[thread overview]
Message-ID: <9d8f49c3-f808-4ee3-891a-f921ae85272d@huawei.com> (raw)
In-Reply-To: <e6e22324-c681-4073-95b9-bb6afb918371@redhat.com>


在 2025/7/25 0:26, David Hildenbrand 写道:
> On 24.07.25 11:09, Jinjiang Tu wrote:
>> Changelog since v1:
>>   * update the subject pacth #1
>>   * add patch #2 and #3 to hold PTL for some other .hugetlb_entry 
>> callbacks
>>
>> Patch #1 fixes a race between smaps_hugetlb_range() and migration by 
>> holding
>> PTL in smaps_hugetlb_range().
>>
>> To avoid operating on stale pages, add PTL for several .hugetlb_entry
>> callbacks too. We don't hold PTL in __s390_enable_skey_hugetlb() and
>> prot_none_hugetlb_entry(), since the mmap write lock is held.
>
> There could be rmap walkers only holding the rmap lock (but I recall 
> that s390x does not support migration of hugetlb folios, not sure).
>
> In any, case, ok to leave that alone for now.
>
> We don't
>> hold PTL in hwpoison_hugetlb_range() too, since it only reads the pte 
>> and
>> doesn't operate the page.
>
> Not sure ... we should just handle it like the PTE/PMD case and not 
> play any tricks.
>
Indeed, I will update hwpoison_hugetlb_range() too.


  reply	other threads:[~2025-07-25  2:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24  9:09 Jinjiang Tu
2025-07-24  9:09 ` [PATCH v2 1/3] mm/smaps: fix race between smaps_hugetlb_range and migration Jinjiang Tu
2025-07-24 16:27   ` David Hildenbrand
2025-07-24  9:09 ` [PATCH v2 2/3] fs/proc/task_mmu: hold PTL in pagemap_hugetlb_range and gather_hugetlb_stats Jinjiang Tu
2025-07-24 16:27   ` David Hildenbrand
2025-07-24  9:09 ` [PATCH v2 3/3] mm/mincore: hold PTL in mincore_hugetlb Jinjiang Tu
2025-07-24 16:29   ` David Hildenbrand
2025-07-24 16:26 ` [PATCH v2 0/3] hold PTL for several .hugetlb_entry callbacks David Hildenbrand
2025-07-25  2:02   ` Jinjiang Tu [this message]
2025-07-25  3:31 ` [PATCH] mm/memory-failure: hold PTL in hwpoison_hugetlb_range Jinjiang Tu
2025-07-25 15:48   ` David Hildenbrand
2025-07-25 23:29   ` Andrew Morton
2025-07-26  0:28     ` Jinjiang Tu

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=9d8f49c3-f808-4ee3-891a-f921ae85272d@huawei.com \
    --to=tujinjiang@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=avagin@gmail.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=brahmajit.xyz@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=hughd@google.com \
    --cc=joern@logfs.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=rientjes@google.com \
    --cc=ryan.roberts@arm.com \
    --cc=superman.xpt@gmail.com \
    --cc=thiago.bauermann@linaro.org \
    --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