xen: credit2: allocate runqueue data structure dynamically
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 23 Jun 2017 10:54:52 +0000 (12:54 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 21 Jul 2017 17:21:23 +0000 (18:21 +0100)
commitefda30d5916f8eac538faf59d4338d150e034f1b
treefb986bb426cbd14685e6af7dd95007ab6423bb54
parent73771b89fd9d89a23d5c7b760056fdaf94946be9
xen: credit2: allocate runqueue data structure dynamically

Instead of keeping an NR_CPUS big array of csched2_runqueue_data
elements, directly inside the csched2_private structure, allocate
it dynamically.

This has two positive effects:
- reduces the size of csched2_private sensibly, which is
  especially good in case there are more instance of Credit2
  (in different cpupools), and is also good from the point
  of view of fitting the struct into CPU caches;
- we can use nr_cpu_ids as array size, which may be sensibly
  smaller than NR_CPUS

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c