All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-memory-failure-move-hwpoison_filter-higher-up.patch removed from -mm tree
@ 2024-06-25  4:59 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2024-06-25  4:59 UTC (permalink / raw)
  To: mm-commits, osalvador, oalvador, nao.horiguchi, linmiaohe,
	jane.chu, akpm


The quilt patch titled
     Subject: mm/memory-failure: move hwpoison_filter() higher up
has been removed from the -mm tree.  Its filename was
     mm-memory-failure-move-hwpoison_filter-higher-up.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Jane Chu <jane.chu@oracle.com>
Subject: mm/memory-failure: move hwpoison_filter() higher up
Date: Fri, 24 May 2024 15:53:05 -0600

Move hwpoison_filter() higher up as there is no need to spend a lot cycles
only to find out later that the page is supposed to be skipped from
hwpoison handling.

Link: https://lkml.kernel.org/r/20240524215306.2705454-5-jane.chu@oracle.com
Signed-off-by: Jane Chu <jane.chu@oracle.com>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Acked-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Oscar Salvador <oalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memory-failure.c |   20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

--- a/mm/memory-failure.c~mm-memory-failure-move-hwpoison_filter-higher-up
+++ a/mm/memory-failure.c
@@ -2300,6 +2300,18 @@ try_again:
 	}
 
 	folio = page_folio(p);
+
+	/* filter pages that are protected from hwpoison test by users */
+	folio_lock(folio);
+	if (hwpoison_filter(p)) {
+		ClearPageHWPoison(p);
+		folio_unlock(folio);
+		folio_put(folio);
+		res = -EOPNOTSUPP;
+		goto unlock_mutex;
+	}
+	folio_unlock(folio);
+
 	if (folio_test_large(folio)) {
 		/*
 		 * The flag must be set after the refcount is bumped
@@ -2363,14 +2375,6 @@ try_again:
 	 */
 	page_flags = folio->flags;
 
-	if (hwpoison_filter(p)) {
-		ClearPageHWPoison(p);
-		folio_unlock(folio);
-		folio_put(folio);
-		res = -EOPNOTSUPP;
-		goto unlock_mutex;
-	}
-
 	/*
 	 * __munlock_folio() may clear a writeback folio's LRU flag without
 	 * the folio lock. We need to wait for writeback completion for this
_

Patches currently in -mm which might be from jane.chu@oracle.com are



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

only message in thread, other threads:[~2024-06-25  4:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-25  4:59 [merged mm-stable] mm-memory-failure-move-hwpoison_filter-higher-up.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.