]> xenbits.xensource.com Git - people/jgross/xen.git/commit
xen: credit2: limit the max number of CPUs in a runqueue
authorDario Faggioli <dfaggioli@suse.com>
Thu, 28 May 2020 21:29:44 +0000 (23:29 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 29 May 2020 17:53:54 +0000 (18:53 +0100)
commit8e2aa76dc1670e82eaa15683353853bc66bf54fc
treedb197ab6ae6ce4d28748699a223cd1f6ba3ceba4
parent524cc89c288b9ec5ae94f3e9b28a9c460b997cc2
xen: credit2: limit the max number of CPUs in a runqueue

In Credit2 CPUs (can) share runqueues, depending on the topology. For
instance, with per-socket runqueues (the default) all the CPUs that are
part of the same socket share a runqueue.

On platform with a huge number of CPUs per socket, that could be a
problem. An example is AMD EPYC2 servers, where we can have up to 128
CPUs in a socket.

It is of course possible to define other, still topology-based, runqueue
arrangements (e.g., per-LLC, per-DIE, etc). But that may still result in
runqueues with too many CPUs on other/future platforms. For instance, a
system with 96 CPUs and 2 NUMA nodes will end up having 48 CPUs per
runqueue. Not as bad, but still a lot!

Therefore, let's set a limit to the max number of CPUs that can share a
Credit2 runqueue. The actual value is configurable (at boot time), the
default being 16. If, for instance,  there are more than 16 CPUs in a
socket, they'll be split among two (or more) runqueues.

Note: with core scheduling enabled, this parameter sets the max number
of *scheduling resources* that can share a runqueue. Therefore, with
granularity set to core (and assumint 2 threads per core), we will have
at most 16 cores per runqueue, which corresponds to 32 threads. But that
is fine, considering how core scheduling works.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
docs/misc/xen-command-line.pandoc
xen/common/sched/credit2.c
xen/include/asm-arm/cpufeature.h
xen/include/asm-x86/processor.h