mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Yejune Deng <yejune.deng@gmail.com>,
	mingo@redhat.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	linux-kernel@vger.kernel.org, Yejune Deng <yejunedeng@gmail.com>
Subject: Re: [PATCH] sched: simplify is_cpu_allowed() code
Date: Tue, 18 May 2021 09:48:07 -0400	[thread overview]
Message-ID: <20210518094807.57cb7fb7@gandalf.local.home> (raw)
In-Reply-To: <YKPA0v3we3WTWIy2@hirez.programming.kicks-ass.net>

On Tue, 18 May 2021 15:27:46 +0200
Peter Zijlstra <peterz@infradead.org> wrote:

> On Tue, May 18, 2021 at 08:54:46PM +0800, Yejune Deng wrote:
> > Combine multiple if statements that return the same value.  
> 
> This patch is not a nop; You now deny cpu_dying() for everyone, while we
> explicitly allow it for kthread_is_per_cpu().

Right. The patch is flawed in many ways. You don't combine if statements
just because they return the same value, if you are messing with the order
of the checks.

	if (A)
		return false;

	if (B)
		return true;

	if (C)
		return false;

is not the same as

	if (A || C)
		return false

	if (B)
		return true;

Please don't do that.

-- Steve

      reply	other threads:[~2021-05-18 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-18 12:54 Yejune Deng
2021-05-18 13:27 ` Peter Zijlstra
2021-05-18 13:48   ` 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=20210518094807.57cb7fb7@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    --cc=yejune.deng@gmail.com \
    --cc=yejunedeng@gmail.com \
    /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®