mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Zhang, Rui" <rui.zhang@intel.com>
To: "peterz@infradead.org" <peterz@infradead.org>,
	"Tang, Feng" <feng.tang@intel.com>
Cc: "Chen, Tim C" <tim.c.chen@intel.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"x86@kernel.org" <x86@kernel.org>,
	"paulmck@kernel.org" <paulmck@kernel.org>,
	"Woodhouse, David" <dwmw@amazon.co.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [Patch v2 2/2] x86/tsc: use logical_packages as a better estimation of socket numbers
Date: Fri, 16 Jun 2023 06:53:21 +0000	[thread overview]
Message-ID: <d97fe59e47de77a36746107e4070e44ed46bf4d1.camel@intel.com> (raw)
In-Reply-To: <20230615092021.GE1683497@hirez.programming.kicks-ass.net>

On Thu, 2023-06-15 at 11:20 +0200, Peter Zijlstra wrote:
> On Tue, Jun 13, 2023 at 01:25:23PM +0800, Feng Tang wrote:
> > Commit b50db7095fe0 ("x86/tsc: Disable clocksource watchdog for TSC
> > on qualified platorms") was introduced to solve problem that
> > sometimes TSC clocksource is wrongly judged as unstable by watchdog
> > like 'jiffies', HPET, etc.
> > 
> > In it, the hardware socket number is a key factor for judging
> > whether
> > to disable the watchdog for TSC, and 'nr_online_nodes' was chosen
> > as
> > an estimation due to it is needed in early boot phase before
> > registering 'tsc-early' clocksource, where all none-boot CPUs are
> > not
> > brought up yet.
> > 
> > In recent patch review, Dave and Rui pointed out there are many
> > cases
> > in which 'nr_online_nodes' is not accurate, like:
> > 
> > * numa emulation (numa=fake=4 etc.)
> > * numa=off
> > * platforms with CPU-less HBM nodes, CPU-less Optane memory nodes.
> > * SNC (sub-numa cluster) mode enabled
> > * 'nr_cpus=' and 'maxcpus=' kernel cmdline parameter setup
> > 
> > Peter Zijlstra suggested 'logical_packages', and it seems to be the
> > best option we have as it covers all the cases above except the
> > last one. But it is only usable after smp_init() and all CPUs are
> > brought up, while 'tsc-early' is initialized before that.
> > 
> > One solution is to skip the watchdog for 'tsc-early' clocksource,
> > and move the check after smp_init(), while before 'tsc' clocksource
> > is registered, where 'logical_packages' could be used.
> > 
> > For 'nr_cpus' and 'maxcpus' cmdline case, the global flag
> > 'package_count_unreliable' will be set to true and the watchdog
> > will be kept as is.
> 
> So I have at least two machines where I boot with 'possible_cpus=#'
> because the BIOS MADT is reporting a stupid number of CPUs that
> aren't
> actually there.

Does the MADT report those CPUs as disabled but online capable?
can you send me a copy of the acpidmp?

I had a patch to parse MADT and count the number of physical packages
by decoding all the valid APICIDs in MADT.
I'm wondering if the patch still works on this machine.

> 
> So I think I'm lucky and side-stepped this nonsense, but if someone
> were
> to use nr_cpus= for this same purpose, they get screwed over and get
> the
> watchdog. Sad day for them I suppose.

what if using package_count_from_MADT?

thanks,
rui

  reply	other threads:[~2023-06-16  6:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  5:25 [Patch v2 1/2] smp: Add helper function to mark possible bad package number Feng Tang
2023-06-13  5:25 ` [Patch v2 2/2] x86/tsc: use logical_packages as a better estimation of socket numbers Feng Tang
2023-06-15  9:20   ` Peter Zijlstra
2023-06-16  6:53     ` Zhang, Rui [this message]
2023-06-16  8:02       ` Peter Zijlstra
2023-06-16  8:10         ` Peter Zijlstra
2023-06-16  9:19           ` Zhang, Rui
2023-06-16  9:42             ` Peter Zijlstra
2023-06-16 11:23               ` Zhang, Rui
2023-06-16 11:47                 ` Feng Tang
2023-06-16  8:22         ` Peter Zijlstra
2023-06-19 10:42         ` Feng Tang
2023-06-16  7:18     ` Feng Tang
2023-06-22 14:27       ` Thomas Gleixner
2023-06-22 23:07         ` Thomas Gleixner
2023-06-23 15:49           ` Zhang, Rui
     [not found]           ` <ZJW0gi5oQQbxf8Df@feng-clx>
2023-06-25 14:51             ` Feng Tang
2023-06-27 11:14               ` Thomas Gleixner
2023-06-29 13:27                 ` Feng Tang
2023-07-17 13:38                   ` Feng Tang
2023-07-26 19:37                     ` Thomas Gleixner
2023-07-27  1:24                       ` Feng Tang
2023-06-23 15:36         ` Zhang, Rui

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=d97fe59e47de77a36746107e4070e44ed46bf4d1.camel@intel.com \
    --to=rui.zhang@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dwmw@amazon.co.uk \
    --cc=feng.tang@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tim.c.chen@intel.com \
    --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