[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10610b21-45a7-4ada-b421-f4d378877450@arm.com>
Date: Fri, 7 Feb 2025 12:39:54 +0530
From: Dev Jain <dev.jain@....com>
To: Liu Ye <liuye@...inos.cn>, akpm@...ux-foundation.org,
Liam.Howlett@...cle.com, lorenzo.stoakes@...cle.com, vbabka@...e.cz,
jannh@...gle.com
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/mlock: Fix WARN_ON_ONCE condition.
On 07/02/25 11:34 am, Liu Ye wrote:
> The condition in WARN_ON_ONCE(cpu_online(cpu)) should be !cpu_online(cpu)
> to ensure the warning is triggered when the CPU is offline.
>
> Signed-off-by: Liu Ye <liuye@...inos.cn>
> ---
> mm/mlock.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mlock.c b/mm/mlock.c
> index cde076fa7d5e..40acf7897917 100644
> --- a/mm/mlock.c
> +++ b/mm/mlock.c
> @@ -224,7 +224,7 @@ void mlock_drain_remote(int cpu)
> {
> struct folio_batch *fbatch;
>
> - WARN_ON_ONCE(cpu_online(cpu));
> + WARN_ON_ONCE(!cpu_online(cpu));
> fbatch = &per_cpu(mlock_fbatch.fbatch, cpu);
> if (folio_batch_count(fbatch))
> mlock_folio_batch(fbatch);
No idea about this code path but mlock_drain_remote() is called by
page_alloc_cpu_dead() which expects an offlined CPU according to the
comments.
Powered by blists - more mailing lists