public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yury Norov <yury.norov@gmail.com>
To: Sander Vanheule <sander@svanheule.net>
Cc: "Andrew Morton" <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Brendan Higgins" <brendanhiggins@google.com>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"David Gow" <davidgow@google.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Maíra Canal" <mairacanal@riseup.net>,
	"Marco Elver" <elver@google.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Valentin Schneider" <vschneid@redhat.com>
Subject: Re: [PATCH v5 0/5] cpumask: fix invalid uniprocessor assumptions
Date: Sun, 31 Jul 2022 08:28:24 -0700	[thread overview]
Message-ID: <YuafmMimidHkmUOy@yury-laptop> (raw)
In-Reply-To: <a5b3bc76d48acb8fde00aa95c6a572d7922c050c.camel@svanheule.net>

On Sun, Jul 31, 2022 at 03:02:55PM +0200, Sander Vanheule wrote:
> On Sat, 2022-07-30 at 11:15 -0700, Yury Norov wrote:
> > On Fri, Jul 29, 2022 at 09:01:17AM +0200, Sander Vanheule wrote:
> > > On uniprocessor builds, it is currently assumed that any cpumask will
> > > contain the single CPU: cpu0. This assumption is used to provide
> > > optimised implementations.
> > > 
> > > The current assumption also appears to be wrong, by ignoring the fact
> > > that users can provide empty cpumasks. This can result in bugs as
> > > explained in [1] - for_each_cpu() will run one iteration of the loop
> > > even when passed an empty cpumask.
> > > 
> > > This series introduces some basic tests, and updates the optimisations
> > > for uniprocessor builds.
> > > 
> > > The x86 patch was written after the kernel test robot [2] ran into a
> > > failed build. I have tried to list the files potentially affected by the
> > > changes to cpumask.h, in an attempt to find any other cases that fail on
> > > !SMP. I've gone through some of the files manually, and ran a few cross
> > > builds, but nothing else popped up. I (build) checked about half of the
> > > potientally affected files, but I do not have the resources to do them
> > > all. I hope we can fix other issues if/when they pop up later.
> > > 
> > > [1] https://lore.kernel.org/all/20220530082552.46113-1-sander@svanheule.net/
> > > [2] https://lore.kernel.org/all/202206060858.wA0FOzRy-lkp@intel.com/
> >  
> > Hi Sander,
> > 
> > I tried to apply it on top of bitmap-for next, and there are many conflicts
> > with already pulled patches. There's nothing really scary, just functions
> > changed their prototypes and locations. Can you try your series on top of
> > bitmap-for-next from git@github.com:/norov/linux.git (or just -next)? 
> > 
> > I'm asking you to do it instead of doing myself because I don't want to
> > screwup your code accidentally and because many cpumask functions in -next
> > are moved to the header, and it would be probably possible to avoid building 
> > cpumask.o in UP case.
> > 
> > Briefly looking into the -next code, cpumask.c hosts  only cpumask_next_wrap()
> > that is not overwritten by UP code, and in UP case it can be simplified.
> 
> Sure. I've rebased my patches and added a UP-version for cpumask_next_wrap(), so
> cpumask.o doesn't have to be built anymore in that case.

Thanks!
 
> How would you like to proceed with these patches? It's fine by me if you take
> them through your tree to avoid more merge conflicts with your changes, but then
> Andrew woud have to drop the series from mm-nonmm-stable.

I also thing that it should go through bitmap thee. Andrew, are you OK with
that?

      reply	other threads:[~2022-07-31 15:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29  7:01 [PATCH v5 0/5] cpumask: fix invalid uniprocessor assumptions Sander Vanheule
2022-07-29  7:01 ` [PATCH v5 1/5] x86/cacheinfo: move shared cache map definitions Sander Vanheule
2022-08-02 11:13   ` Ingo Molnar
2022-07-29  7:01 ` [PATCH v5 2/5] cpumask: add UP optimised for_each_*_cpu versions Sander Vanheule
2022-07-29  7:01 ` [PATCH v5 3/5] cpumask: fix invalid uniprocessor mask assumption Sander Vanheule
2022-08-08 16:23   ` [RFC] issue with cpumask for UniProcessor Saurabh Sengar
2022-08-08 17:34     ` Sander Vanheule
2022-07-29  7:01 ` [PATCH v5 4/5] lib/test: introduce cpumask KUnit test suite Sander Vanheule
2022-07-31 15:23   ` Maíra Canal
2022-07-31 15:42     ` Sander Vanheule
2022-07-31 22:11       ` Maíra Canal
2022-08-09 18:38     ` Sander Vanheule
2022-07-29  7:01 ` [PATCH v5 5/5] cpumask: update cpumask_next_wrap() signature Sander Vanheule
2022-07-30 18:15 ` [PATCH v5 0/5] cpumask: fix invalid uniprocessor assumptions Yury Norov
2022-07-31 13:02   ` Sander Vanheule
2022-07-31 15:28     ` Yury Norov [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=YuafmMimidHkmUOy@yury-laptop \
    --to=yury.norov@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=brendanhiggins@google.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=davidgow@google.com \
    --cc=elver@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mairacanal@riseup.net \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sander@svanheule.net \
    --cc=tglx@linutronix.de \
    --cc=vschneid@redhat.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