* [merged mm-stable] mm-memory-failure-add-macro-get_page_max_retry_num.patch removed from -mm tree
@ 2024-06-25 5:01 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2024-06-25 5:01 UTC (permalink / raw)
To: mm-commits, tony.luck, nao.horiguchi, lkp, david, bp, linmiaohe,
akpm
The quilt patch titled
Subject: mm/memory-failure: add macro GET_PAGE_MAX_RETRY_NUM
has been removed from the -mm tree. Its filename was
mm-memory-failure-add-macro-get_page_max_retry_num.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: Miaohe Lin <linmiaohe@huawei.com>
Subject: mm/memory-failure: add macro GET_PAGE_MAX_RETRY_NUM
Date: Wed, 12 Jun 2024 15:18:25 +0800
Add helper macro GET_PAGE_MAX_RETRY_NUM to replace magic number 3. No
functional change intended.
Link: https://lkml.kernel.org/r/20240612071835.157004-4-linmiaohe@huawei.com
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: kernel test robot <lkp@intel.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/memory-failure.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--- a/mm/memory-failure.c~mm-memory-failure-add-macro-get_page_max_retry_num
+++ a/mm/memory-failure.c
@@ -1417,6 +1417,8 @@ static int __get_hwpoison_page(struct pa
return 0;
}
+#define GET_PAGE_MAX_RETRY_NUM 3
+
static int get_any_page(struct page *p, unsigned long flags)
{
int ret = 0, pass = 0;
@@ -1431,12 +1433,12 @@ try_again:
if (!ret) {
if (page_count(p)) {
/* We raced with an allocation, retry. */
- if (pass++ < 3)
+ if (pass++ < GET_PAGE_MAX_RETRY_NUM)
goto try_again;
ret = -EBUSY;
} else if (!PageHuge(p) && !is_free_buddy_page(p)) {
/* We raced with put_page, retry. */
- if (pass++ < 3)
+ if (pass++ < GET_PAGE_MAX_RETRY_NUM)
goto try_again;
ret = -EIO;
}
@@ -1462,7 +1464,7 @@ try_again:
* A page we cannot handle. Check whether we can turn
* it into something we can handle.
*/
- if (pass++ < 3) {
+ if (pass++ < GET_PAGE_MAX_RETRY_NUM) {
put_page(p);
shake_page(p);
count_increased = false;
_
Patches currently in -mm which might be from linmiaohe@huawei.com are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-06-25 5:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-25 5:01 [merged mm-stable] mm-memory-failure-add-macro-get_page_max_retry_num.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.