[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20240702124334.762dbd5a@rorschach.local.home>
Date: Tue, 2 Jul 2024 12:43:34 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: <xu.xin16@....com.cn>
Cc: <mingo@...hat.com>, <peterz@...radead.org>, <juri.lelli@...hat.com>,
<vincent.guittot@...aro.org>, <ietmar.eggemann@....com>,
<ostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
<bristot@...hat.com>, <he.peilin@....com.cn>, <yang.yang29@....com.cn>,
<tu.qiang35@....com.cn>, <jiang.kun2@....com.cn>,
<zhang.yunkai@....com.cn>, <liu.chun2@....com.cn>, <fan.yu9@....com.cn>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH linux-next RESEND] sched/core: Add WARN() to checks in
migrate_disable()
On Tue, 2 Jul 2024 19:33:59 +0800 (CST)
<xu.xin16@....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;
> }
Powered by blists - more mailing lists