From: Peter Zijlstra <peterz@infradead.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Andi Kleen <andi@firstfloor.org>,
linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
x86@kernel.org, Ingo Molnar <mingo@kernel.org>,
Frank Ramsay <framsay@redhat.com>,
Prarit Bhargava <prarit@redhat.com>
Subject: Re: [PATCH] x86/smp: Fix __max_logical_packages value setup
Date: Thu, 11 Aug 2016 14:48:39 +0200 [thread overview]
Message-ID: <20160811124839.GQ6879@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20160810161417.GA11369@krava>
On Wed, Aug 10, 2016 at 06:14:18PM +0200, Jiri Olsa wrote:
> > Maybe one nit, the variable is no longer used for a max, so maybe rename
> > it too?
> diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
> index cf75871d2f81..c28010088651 100644
> --- a/arch/x86/include/asm/topology.h
> +++ b/arch/x86/include/asm/topology.h
> @@ -118,8 +118,8 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu);
> #define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
> #define topology_sibling_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))
>
> -extern unsigned int __max_logical_packages;
> -#define topology_max_packages() (__max_logical_packages)
> +extern unsigned int logical_packages;
> +#define topology_max_packages() (logical_packages)
>
> extern int __max_smt_threads;
>
Aaahh, I missed this bit yesterday..
Imagine a machine with physical hotplug, where we boot with half the
sockets populated (say 2), then topology_max_packages() will return 2
when we run the uncore driver init.
That driver will allocate resources based on 2.
Then we physically hotplug the remaining sockets (another 2), which will
result in topology_max_packages() to now return 4.
When we run the cpuhotplug hook, it will try and access resources based
on 4, which were not allocated.
blergh..
next prev parent reply other threads:[~2016-08-11 12:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-03 16:23 [RFC][PATCH] " Jiri Olsa
2016-08-10 11:41 ` Jiri Olsa
2016-08-10 13:54 ` Peter Zijlstra
2016-08-10 14:00 ` Jiri Olsa
2016-08-10 14:15 ` Jiri Olsa
2016-08-10 15:52 ` Peter Zijlstra
2016-08-10 16:14 ` [PATCH] " Jiri Olsa
2016-08-11 12:48 ` Peter Zijlstra [this message]
2016-08-11 13:05 ` Jiri Olsa
2016-08-11 13:46 ` Peter Zijlstra
2016-08-12 12:24 ` Jiri Olsa
2016-08-12 13:12 ` Jiri Olsa
2016-08-15 9:04 ` Peter Zijlstra
2016-08-15 10:17 ` Jiri Olsa
2016-08-15 11:46 ` Prarit Bhargava
2016-08-18 10:50 ` [tip:x86/urgent] " tip-bot for Jiri Olsa
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=20160811124839.GQ6879@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--cc=framsay@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=prarit@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
Powered by JetHome