]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
xen/cpupool: add missing bits for per-cpupool scheduling granularity
authorJuergen Gross <jgross@suse.com>
Wed, 2 Dec 2020 09:12:37 +0000 (10:12 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 2 Dec 2020 09:12:37 +0000 (10:12 +0100)
Even with storing the scheduling granularity in struct cpupool there
are still a few bits missing for being able to have cpupools with
different granularity (apart from the missing interface for setting
the individual granularities): the number of cpus in a scheduling
unit is always taken from the global sched_granularity variable.

So store the value in struct cpupool and use that instead of
sched_granularity.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
xen/common/sched/cpupool.c
xen/common/sched/private.h

index 7ea641ca261e63ee4b3ea3cd741f43e7299a4f5f..6429c8f7b5e5ed61f2eb8db5bccb78665a03d436 100644 (file)
@@ -151,7 +151,7 @@ static void __init cpupool_gran_init(void)
 
 unsigned int cpupool_get_granularity(const struct cpupool *c)
 {
-    return c ? sched_granularity : 1;
+    return c ? c->sched_gran : 1;
 }
 
 static void free_cpupool_struct(struct cpupool *c)
@@ -289,6 +289,7 @@ static struct cpupool *cpupool_create(
     }
     c->sched->cpupool = c;
     c->gran = opt_sched_granularity;
+    c->sched_gran = sched_granularity;
 
     *q = c;
 
index df50976eb2903bfc0f25b9a1a557b3b71411e69f..685992cab95d21dca6bd72ae6ef069ad9d2246ad 100644 (file)
@@ -514,6 +514,7 @@ struct cpupool
     struct scheduler *sched;
     atomic_t         refcnt;
     enum sched_gran  gran;
+    unsigned int     sched_gran;     /* Number of cpus per sched-item. */
 };
 
 static inline cpumask_t *cpupool_domain_master_cpumask(const struct domain *d)