public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM
@ 2026-04-02  6:49 wangxuewen
  2026-04-03  0:36 ` SeongJae Park
  2026-04-03  2:19 ` Miaohe Lin
  0 siblings, 2 replies; 3+ messages in thread
From: wangxuewen @ 2026-04-02  6:49 UTC (permalink / raw)
  To: linmiaohe, nao.horiguchi, akpm; +Cc: linux-mm, linux-kernel, wangxuewen

From: wangxuewen <wangxuewen@kylinos.cn>

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@kylinos.cn>
---
 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;
 			}
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM
  2026-04-02  6:49 [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM wangxuewen
@ 2026-04-03  0:36 ` SeongJae Park
  2026-04-03  2:19 ` Miaohe Lin
  1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2026-04-03  0:36 UTC (permalink / raw)
  To: wangxuewen
  Cc: SeongJae Park, linmiaohe, nao.horiguchi, akpm, linux-mm,
	linux-kernel, wangxuewen

On Thu,  2 Apr 2026 14:49:46 +0800 wangxuewen <18810879172@163.com> wrote:

> From: wangxuewen <wangxuewen@kylinos.cn>
> 
> 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@kylinos.cn>

Acked-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM
  2026-04-02  6:49 [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM wangxuewen
  2026-04-03  0:36 ` SeongJae Park
@ 2026-04-03  2:19 ` Miaohe Lin
  1 sibling, 0 replies; 3+ messages in thread
From: Miaohe Lin @ 2026-04-03  2:19 UTC (permalink / raw)
  To: wangxuewen; +Cc: linux-mm, linux-kernel, wangxuewen, nao.horiguchi, akpm

On 2026/4/2 14:49, wangxuewen wrote:
> From: wangxuewen <wangxuewen@kylinos.cn>
> 
> 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@kylinos.cn>

Acked-by: Miaohe Lin <linmiaohe@huawei.com>

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;
>  			}
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-03  2:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-02  6:49 [PATCH v1] mm/memory-failure: replace magic number 3 with GET_PAGE_MAX_RETRY_NUM wangxuewen
2026-04-03  0:36 ` SeongJae Park
2026-04-03  2:19 ` Miaohe Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox