mm/memory-failure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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
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;
> }
>
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 [...]
© 2016 - 2026 Red Hat, Inc.