lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210518094807.57cb7fb7@gandalf.local.home>
Date:   Tue, 18 May 2021 09:48:07 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Yejune Deng <yejune.deng@...il.com>, mingo@...hat.com,
        juri.lelli@...hat.com, vincent.guittot@...aro.org,
        dietmar.eggemann@....com, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, linux-kernel@...r.kernel.org,
        Yejune Deng <yejunedeng@...il.com>
Subject: Re: [PATCH] sched: simplify is_cpu_allowed() code

On Tue, 18 May 2021 15:27:46 +0200
Peter Zijlstra <peterz@...radead.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ