All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] mm-memory-failure-ensure-collect_procs-is-retried-when-unmap-fails.patch removed from -mm tree
@ 2025-09-24 22:25 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-09-24 22:25 UTC (permalink / raw)
  To: mm-commits, zhang.run, nao.horiguchi, mawupeng1, linmiaohe,
	hu.shengming, david, shengminghu512, akpm


The quilt patch titled
     Subject: mm/memory-failure: ensure collect_procs is retried when unmap fails
has been removed from the -mm tree.  Its filename was
     mm-memory-failure-ensure-collect_procs-is-retried-when-unmap-fails.patch

This patch was dropped because an updated version will be issued

------------------------------------------------------
From: Shengming Hu <shengminghu512@qq.com>
Subject: mm/memory-failure: ensure collect_procs is retried when unmap fails
Date: Tue, 23 Sep 2025 22:57:09 +0800

In the memory_failure process, if collect_procs is not executed with the
flag set, the to_kill list may be empty.  Even if there are pages that
fail to be unmapped, SIGKILL or SIGBUS cannot be sent to the process via
collect_procs.

This patch fixes the issue by re-executing collect_procs when the to_kill
list is empty and unmap fails.  This collects processes with unmap
failures into the to_kill list, allowing SIGBUS or SIGKILL to terminate
them in subsequent code.

Link: https://lkml.kernel.org/r/tencent_EDEED996FC685E61AADA14A23BCE9CCDAF09@qq.com
Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Zhang Run <zhang.run@zte.com.cn>
Cc: Ma Wupeng <mawupeng1@huawei.com>
Cc: David Hildenbrand <david@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory-failure.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/mm/memory-failure.c~mm-memory-failure-ensure-collect_procs-is-retried-when-unmap-fails
+++ a/mm/memory-failure.c
@@ -1600,9 +1600,12 @@ static bool hwpoison_user_mappings(struc
 	collect_procs(folio, p, &tokill, flags & MF_ACTION_REQUIRED);
 
 	unmap_success = !unmap_poisoned_folio(folio, pfn, flags & MF_MUST_KILL);
-	if (!unmap_success)
+	if (!unmap_success) {
 		pr_err("%#lx: failed to unmap page (folio mapcount=%d)\n",
 		       pfn, folio_mapcount(folio));
+		if (list_empty(&tokill))
+			collect_procs(folio, p, &tokill, 1);
+	}
 
 	/*
 	 * try_to_unmap() might put mlocked page in lru cache, so call
_

Patches currently in -mm which might be from shengminghu512@qq.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-24 22:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-24 22:25 [to-be-updated] mm-memory-failure-ensure-collect_procs-is-retried-when-unmap-fails.patch removed from -mm tree Andrew Morton

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.