linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] hold PTL for several .hugetlb_entry callbacks
@ 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
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Jinjiang Tu @ 2025-07-24  9:09 UTC (permalink / raw)
  To: akpm, david, dev.jain, catalin.marinas, lorenzo.stoakes,
	thiago.bauermann, superman.xpt, christophe.leroy, brahmajit.xyz,
	andrii, avagin, baolin.wang, ryan.roberts, hughd, rientjes,
	mhocko, joern
  Cc: linux-mm, wangkefeng.wang, tujinjiang

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. We don't
hold PTL in hwpoison_hugetlb_range() too, since it only reads the pte and
doesn't operate the page.

Jinjiang Tu (3):
  mm/smaps: fix race between smaps_hugetlb_range and migration
  fs/proc/task_mmu: hold PTL in pagemap_hugetlb_range and
    gather_hugetlb_stats
  mm/mincore: hold PTL in mincore_hugetlb

 fs/proc/task_mmu.c | 20 ++++++++++++++++----
 mm/mincore.c       |  3 +++
 2 files changed, 19 insertions(+), 4 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-07-26  0:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-24  9:09 [PATCH v2 0/3] hold PTL for several .hugetlb_entry callbacks 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
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

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).