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] [thread-next>] [day] [month] [year] [list]
Message-ID: <YxdiP9+zGdrMCarC@yury-laptop>
Date:   Tue, 6 Sep 2022 08:07:43 -0700
From:   Yury Norov <yury.norov@...il.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     linux-kernel@...r.kernel.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Rasmus Villemoes <linux@...musvillemoes.dk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Stephen Rothwell <sfr@...b.auug.org.au>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Vlastimil Babka <vbabka@...e.cz>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Valentin Schneider <vschneid@...hat.com>,
        Sander Vanheule <sander@...nheule.net>,
        Alexey Klimov <klimov.linux@...il.com>,
        Eric Biggers <ebiggers@...gle.com>
Subject: Re: [PATCH v2 1/5] smp: don't declare nr_cpu_ids if NR_CPUS == 1

On Tue, Sep 06, 2022 at 04:36:39PM +0200, Peter Zijlstra wrote:
> On Tue, Sep 06, 2022 at 07:06:31AM -0700, Yury Norov wrote:
> > On Tue, Sep 06, 2022 at 10:53:53AM +0200, Peter Zijlstra wrote:
> > > On Mon, Sep 05, 2022 at 04:08:16PM -0700, Yury Norov wrote:
> > > > SMP and NR_CPUS are independent options, hence nr_cpu_ids may be
> > > > declared even if NR_CPUS == 1, which is useless.
> > > 
> > > I'm thikning you're fixing the wrong problem here.
> > 
> > I'm removing dead code. If NR_CPUS == 1, nr_cpu_ids does exist, exported
> > as an interface variable, but never normally reached, because in some
> > other piece of code (not even in smp.h) it's declared conditionally. 
> 
> Can't you simply disallow NR_CPUS==1 for SMP builds? It doesn't make
> sense anyway.

There are SMP_ON_UP and SMP_UP options in arm and mips configs. I have
no idea what do they do, but disallowing NR_CPUS==1 && SMP=y looks
unsafe...

 
> > > Why do we need extra source complexity for this?
> > 
> > To have effective code generation for UP builds.
> 
> Again, who cares... isn't it hard to find actual UP chips these days?

What about UP VMs? People are interested in UP. Check for example the
recent b81dce77cedce ("cpumask: Fix invalid uniprocessor mask assumption")

> It was suggested the other day we remove a whole bunch of SMP=n code and
> unconditionally use SMP code, even if its pointless on UP just to make
> the source simpler.

So while SMP=n is there, let's keep the code base coherent?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ