]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM
authorwangxuewen <wangxuewen@kylinos.cn>
Thu, 2 Apr 2026 06:49:46 +0000 (14:49 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 29 May 2026 04:04:51 +0000 (21:04 -0700)
Replace the hardcoded magic number 3 in get_any_page() with the existing
GET_PAGE_MAX_RETRY_NUM macro for code consistency and maintainability.

This change has no functional impact, only improves code readability and
unifies the retry limit configuration.

Link: https://lore.kernel.org/20260402064946.1124250-1-18810879172@163.com
Signed-off-by: wangxuewen <wangxuewen@kylinos.cn>
Acked-by: SeongJae Park <sj@kernel.org>
Acked-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memory-failure.c

index 62b547c168fca0b28e8361ce921a61e61495af60..866c4428ac7efa66864c2d0f0201840b78386010 100644 (file)
@@ -1418,7 +1418,7 @@ try_again:
                         * We raced with (possibly temporary) unhandlable
                         * page, retry.
                         */
-                       if (pass++ < 3) {
+                       if (pass++ < GET_PAGE_MAX_RETRY_NUM) {
                                shake_page(p);
                                goto try_again;
                        }