From: Feng Tang <feng.tang@intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Dave Hansen <dave.hansen@intel.com>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H . Peter Anvin" <hpa@zytor.com>,
"Peter Zijlstra" <peterz@infradead.org>, <x86@kernel.org>,
<paulmck@kernel.org>, <rui.zhang@intel.com>,
Waiman Long <longman@redhat.com>, <linux-kernel@vger.kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH] x86/tsc: Use topology_max_packages() to get package number
Date: Mon, 18 Mar 2024 09:03:19 +0800 [thread overview]
Message-ID: <ZfeS16iHtEYsqs5m@feng-clx.sh.intel.com> (raw)
In-Reply-To: <87r0gbjk17.ffs@tglx>
On Fri, Mar 15, 2024 at 09:51:32PM +0100, Thomas Gleixner wrote:
> On Fri, Mar 15 2024 at 10:58, Dave Hansen wrote:
> > On 3/15/24 04:26, Feng Tang wrote:
> >> /*
> >> * Today neither Intel nor AMD support heterogeneous systems so
> >> * extrapolate the boot cpu's data to all packages.
> >> */
> >> ncpus = cpu_data(0).booted_cores * topology_max_smt_threads();
> >> __max_logical_packages = DIV_ROUND_UP(total_cpus, ncpus);
> >
> > Because Intel obviously has heterogeneous systems today.
>
> Hybrid is a per package property.
>
> But neither Intel nor AMD support populating multi socket systems with
> random packages, where socket 0 has less cores than socket 1 or socket 0
> is hybrid and socket 1 is not.
Before posting the patch, I run the latest upstream kernel with your
topology refactoring patchset on one AlderLake and one MetorLake box,
and they both show the number of package is 1.
>
> > So I'll buy that removing 'nr_online_nodes' takes NUMA out of the
> > picture (which is good), but I want to hear more about why
> > topology_max_packages() and '4' are the right things to be checking.
> >
> > I suspect the real reason '4' was picked was to give the calculation
> > some wiggle room because it's not actually all that precise.
>
> IIRC the TSC is only guaranteed to be synchronized up to 4 sockets, but
> my memory might be wrong as usual.
Yes. I did try to increase the bar to '8' with a patch, and at that
time Peter Zijlstra mentioned there was real issue with TSC found on
some old 8 sockets machine.
Thanks,
Feng
>
> Thanks,
>
> tglx
next prev parent reply other threads:[~2024-03-18 1:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-15 11:26 [PATCH] x86/tsc: Use topology_max_packages() to get package number Feng Tang
2024-03-15 17:58 ` Dave Hansen
2024-03-15 20:51 ` Thomas Gleixner
2024-03-18 1:03 ` Feng Tang [this message]
2024-03-17 12:00 ` Zhang, Rui
2024-03-18 1:18 ` Feng Tang
2024-03-18 15:08 ` Dave Hansen
2024-03-18 1:16 ` Feng Tang
2024-03-18 2:03 ` Waiman Long
2024-03-18 1:57 ` Feng Tang
2024-03-18 16:35 ` Dave Hansen
2024-03-19 2:11 ` Feng Tang
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=ZfeS16iHtEYsqs5m@feng-clx.sh.intel.com \
--to=feng.tang@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=peterz@infradead.org \
--cc=rui.zhang@intel.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