linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Josef Bacik <jbacik@fb.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	kernel-team <Kernel-team@fb.com>,
	x86@kernel.org, Peter Zijlstra <peterz@infradead.org>,
	Kan Liang <kan.liang@intel.com>
Subject: Re: Regression introduced by cf6d445f68974d0b15a14cf6021be38a91f2b5d8
Date: Mon, 9 May 2016 21:48:18 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.11.1605092132090.3540@nanos> (raw)
In-Reply-To: <761b4a2a-0332-7954-f030-c6639f949612@fb.com>

Josef,

On Mon, 9 May 2016, Josef Bacik wrote:

> I've hit a regression that was introduced by the commit in $SUBJECT. I'm
> building a minimal kernel config that doesn't have CONFIG_SMP set, which
> results in the topology for the box to look different than with CONFIG_SMP
> set. Specifically boot_cpu_data.x86_max_cores comes out to 16 without
> CONFIG_SMP set, but 12 with CONFIG_SMP set.

So the commit is just exposing the underlying wreckage.

x86_max_cores is set via:

      detect_extended_topology(), which is a NOOP in case of SMP=n

or

      if the above is not available, which is the case for SMP=n, then it
      uses:

      intel_num_cpu_cores()

      That's using the cache leaf Bits 26-31: 

      Maximum number of addressable IDs for processor cores in the physical
      package

      And that's 16 for this CPU, but that has nothing to do with the actual
      number of cores in the package.

So that explains the wreckage you are seing. We have two options to deal with
this:

1) Make intel_num_cpu_cores() a NOOP for SMP=n, so x86_max_cores = 1

2) Make detect_extended_topology() functional for SMP=n, so the real number of
   cores is detected

Both options work and make sense.

Though I don't know whether the uncore stuff wants to see all boxes of a
package even in the SMP=n case. Kan?

Thanks,

	tglx

  reply	other threads:[~2016-05-09 19:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 18:39 Regression introduced by cf6d445f68974d0b15a14cf6021be38a91f2b5d8 Josef Bacik
2016-05-09 19:48 ` Thomas Gleixner [this message]
2016-05-09 20:55   ` Liang, Kan
2016-05-10  6:51   ` Peter Zijlstra
2016-05-10  7:33 ` [tip:x86/urgent] x86/topology: Set x86_max_cores to 1 for CONFIG_SMP=n tip-bot for Thomas Gleixner

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=alpine.DEB.2.11.1605092132090.3540@nanos \
    --to=tglx@linutronix.de \
    --cc=Kernel-team@fb.com \
    --cc=jbacik@fb.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --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;
as well as URLs for NNTP newsgroup(s).