From: Steven Rostedt <rostedt@goodmis.org>
To: <xu.xin16@zte.com.cn>
Cc: <mingo@redhat.com>, <peterz@infradead.org>,
<juri.lelli@redhat.com>, <vincent.guittot@linaro.org>,
<ietmar.eggemann@arm.com>, <ostedt@goodmis.org>,
<bsegall@google.com>, <mgorman@suse.de>, <bristot@redhat.com>,
<he.peilin@zte.com.cn>, <yang.yang29@zte.com.cn>,
<tu.qiang35@zte.com.cn>, <jiang.kun2@zte.com.cn>,
<zhang.yunkai@zte.com.cn>, <liu.chun2@zte.com.cn>,
<fan.yu9@zte.com.cn>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH linux-next RESEND] sched/core: Add WARN() to checks in migrate_disable()
Date: Tue, 2 Jul 2024 12:43:34 -0400 [thread overview]
Message-ID: <20240702124334.762dbd5a@rorschach.local.home> (raw)
In-Reply-To: <20240702193359997GhKH_KNYXYGLV7TlNVtkq@zte.com.cn>
On Tue, 2 Jul 2024 19:33:59 +0800 (CST)
<xu.xin16@zte.com.cn> wrote:
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -2259,6 +2259,8 @@ void migrate_disable(void)
> struct task_struct *p = current;
>
> if (p->migration_disabled) {
> + if (p->migration_disabled == USHRT_MAX)
> + WARN(1, "migration_disabled has encountered an overflow.\n");
This is redundant, you want:
WARN(p->migration_disabled == USHRT_MAX, "migration_disabled has encountered an overflow.");
I'm not sure the '\n' is needed, but it seems like 50% of WARN() has
them, and 50% do not.
-- Steve
> p->migration_disabled++;
> return;
> }
prev parent reply other threads:[~2024-07-02 16:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-02 11:33 xu.xin16
2024-07-02 16:43 ` Steven Rostedt [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=20240702124334.762dbd5a@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=fan.yu9@zte.com.cn \
--cc=he.peilin@zte.com.cn \
--cc=ietmar.eggemann@arm.com \
--cc=jiang.kun2@zte.com.cn \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=liu.chun2@zte.com.cn \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=ostedt@goodmis.org \
--cc=peterz@infradead.org \
--cc=tu.qiang35@zte.com.cn \
--cc=vincent.guittot@linaro.org \
--cc=xu.xin16@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
--cc=zhang.yunkai@zte.com.cn \
/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
all inboxes | Powered by JetHome®