From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: James Smart <james.smart@broadcom.com>, Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Christoph Hellwig <hch@lst.de>,
James Bottomley <james.bottomley@hansenpartnership.com>,
Daniel Wagner <daniel.wagner@suse.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH] lpfc: fixup out-of-bounds access during CPU hotplug
Date: Wed, 20 Nov 2019 14:45:44 +1100 [thread overview]
Message-ID: <e8330a8f408f6f4c6edbc783c3aebd1cd595ad64.camel@kernel.crashing.org> (raw)
In-Reply-To: <1dca4247-5d02-5232-cd73-a5519f1bbb94@broadcom.com>
On Tue, 2019-11-19 at 09:17 -0800, James Smart wrote:
>
> > Actually, the behaviour of num_possible_cpus() under cpu hotplug seems
> > to be implementation-specific.
> > One might want to set it to the max value at all times, which has the
> > drawback that you'd need to scale per-cpu values with that number,
> > leading to a massive memory overhead as only very few installation
> > will ever reach that number.
> > Others might want to set to the max value at the current
> > configuration, implying that it might change under CPU hotplug.
> > Which seems to be the case for PowerPC, which was the case which
> > triggered the issue at hand.
> > But maybe it was a plain bug in the CPU hotplug implementation; one
> > should be asking BenH for details here.
> >
> > Cheers,
> >
> > Hannes
>
> That sure seems to be at odds with this comment from
> include/linux/cpumask.h:
>
> * The cpu_possible_mask is fixed at boot time, as the set of CPU id's
> * that it is possible might ever be plugged in at anytime during the
> * life of that system boot. The cpu_present_mask is dynamic(*),
> * representing which CPUs are currently plugged in. And
> * cpu_online_mask is the dynamic subset of cpu_present_mask,
> * indicating those CPUs available for scheduling.
>
> and
> #define num_possible_cpus() cpumask_weight(cpu_possible_mask)
Right, it should be fixed at boot. Where do you see powerpc change it ?
Cheers,
Ben.
prev parent reply other threads:[~2019-11-20 3:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-18 12:30 [PATCH] lpfc: fixup out-of-bounds access during CPU hotplug Hannes Reinecke
2019-11-18 13:57 ` Daniel Wagner
2019-11-18 14:22 ` Daniel Wagner
2019-11-18 15:11 ` Hannes Reinecke
2019-11-18 15:36 ` Daniel Wagner
2019-11-18 19:28 ` James Smart
2019-11-18 20:21 ` Hannes Reinecke
2019-11-19 17:17 ` James Smart
2019-11-19 17:34 ` James Smart
2019-11-20 3:46 ` Benjamin Herrenschmidt
2019-11-20 3:45 ` Benjamin Herrenschmidt [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=e8330a8f408f6f4c6edbc783c3aebd1cd595ad64.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=daniel.wagner@suse.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=james.smart@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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