xen: sched: allow for choosing credit2 runqueues configuration at boot
authorDario Faggioli <dario.faggioli@citrix.com>
Tue, 29 Sep 2015 12:05:09 +0000 (14:05 +0200)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 8 Apr 2016 15:02:32 +0000 (16:02 +0100)
commitbcb3914e1fb0d48d3df38fd55177cb1a6f865f6b
treeb452fbb09cd26a410c0356d81927d6c01ba00037
parent58f4e2d4eff3444b5db5a98caada7abe92d3f1e4
xen: sched: allow for choosing credit2 runqueues configuration at boot

In fact, credit2 uses CPU topology to decide how to arrange
its internal runqueues. Before this change, only 'one runqueue
per socket' was allowed. However, experiments have shown that,
for instance, having one runqueue per physical core improves
performance, especially in case hyperthreading is available.

In general, it makes sense to allow users to pick one runqueue
arrangement at boot time, so that:
 - more experiments can be easily performed to even better
   assess and improve performance;
 - one can select the best configuration for his specific
   use case and/or hardware.

This patch enables the above.

Note that, for correctly arranging runqueues to be per-core,
just checking cpu_to_core() on the host CPUs is not enough.
In fact, cores (and hyperthreads) on different sockets, can
have the same core (and thread) IDs! We, therefore, need to
check whether the full topology of two CPUs matches, for
them to be put in the same runqueue.

Note also that the default (although not functional) for
credit2, since now, has been per-socket runqueue. This patch
leaves things that way, to avoid mixing policy and technical
changes.

Finally, it would be a nice feature to be able to select
a particular runqueue arrangement, even when creating a
Credit2 cpupool. This is left as future work.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Signed-off-by: Uma Sharma <uma.sharma523@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
docs/misc/xen-command-line.markdown
xen/common/sched_credit2.c