From: Thomas Gleixner <tglx@linutronix.de>
To: Dave Hansen <dave.hansen@intel.com>,
Feng Tang <feng.tang@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
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: [PATCH] x86/tsc: Use topology_max_packages() to get package number
Date: Fri, 15 Mar 2024 21:51:32 +0100 [thread overview]
Message-ID: <87r0gbjk17.ffs@tglx> (raw)
In-Reply-To: <ce02f1a8-870f-41bc-8650-4bd6103f9637@intel.com>
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.
> 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.
Thanks,
tglx
next prev parent reply other threads:[~2024-03-15 20:51 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 [this message]
2024-03-18 1:03 ` Feng Tang
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=87r0gbjk17.ffs@tglx \
--to=tglx@linutronix.de \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=feng.tang@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.