Re: [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM
From: Miaohe Lin
Date: Thu Apr 02 2026 - 22:20:22 EST
On 2026/4/2 14:49, wangxuewen wrote:
> From: wangxuewen <wangxuewen@xxxxxxxxxx>
>
> 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.
>
> Signed-off-by: wangxuewen <wangxuewen@xxxxxxxxxx>
Acked-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
Thanks.
.
> ---
> mm/memory-failure.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index ee42d4361309..e5a6b1353d9e 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1418,7 +1418,7 @@ static int get_any_page(struct page *p, unsigned long flags)
> * We raced with (possibly temporary) unhandlable
> * page, retry.
> */
> - if (pass++ < 3) {
> + if (pass++ < GET_PAGE_MAX_RETRY_NUM) {
> shake_page(p);
> goto try_again;
> }
>