Re: [RFC PATCH v2] Introduce Hierarchical Per-CPU Counters
From: Paul E. McKenney
Date: Tue Apr 08 2025 - 17:47:00 EST
On Tue, Apr 08, 2025 at 02:21:59PM -0700, Christoph Lameter (Ampere) wrote:
> On Tue, 8 Apr 2025, Paul E. McKenney wrote:
>
> > RCU handles this by iterating from zero to nr_cpu_ids, which is set during
> > early boot. It also builds its tree-shaped data structures during early
> > boot based on nr_cpu_ids.
>
> nr_cpu_ids is better but there are funky things like the default bios of a
> major server vendor indicating 256 or so possible cpus although only 2
> were installed. Thus nr_cpu_id is 256. Presumably some hardware
> configurations can support onlining 256 cpus....
Indeed there are. So some portions of RCU build for nr_cpu_ids but
activate portions of the data structures (e.g., spawn kthreads) only
for those CPUs that actually come online at least once.
But should we really be optimizing to that degree for that sort of
breakage? Just extra data structure, who cares?
Yes, I do understand that the vendor in question, whoever it is, would
not consider their default BIOS to be broken. They are welcome to
their opinion. ;-)
Thanx, Paul