From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Liu Ye <liuye@kylinos.cn>
Cc: akpm@linux-foundation.org, Liam.Howlett@oracle.com,
vbabka@suse.cz, jannh@google.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/mlock: Fix WARN_ON_ONCE condition.
Date: Fri, 7 Feb 2025 09:28:10 +0000 [thread overview]
Message-ID: <57fa3641-4166-4a0d-8851-2bddb4a19f1c@lucifer.local> (raw)
In-Reply-To: <20250207060448.146606-1-liuye@kylinos.cn>
On Fri, Feb 07, 2025 at 02:04:48PM +0800, 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@kylinos.cn>
NACK.
This is a really odd patch to send, if you were right we'd be seeing
constant warnings on this no? And as per Dev, this seems completely wrong?
You also MUST provide more justification if you're going to do something as
crazy as this. An 'it's wrong because I say it is' isn't acceptable on any
level whatsoever.
> ---
> 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);
> --
> 2.25.1
>
prev parent reply other threads:[~2025-02-07 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 6:04 Liu Ye
2025-02-07 7:09 ` Dev Jain
2025-02-07 9:28 ` Lorenzo Stoakes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57fa3641-4166-4a0d-8851-2bddb4a19f1c@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=liuye@kylinos.cn \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox