[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen: cpupool: add a back-pointer from a scheduler to its pool



commit 524cc89c288b9ec5ae94f3e9b28a9c460b997cc2
Author:     Dario Faggioli <dfaggioli@xxxxxxxx>
AuthorDate: Thu May 28 23:29:37 2020 +0200
Commit:     George Dunlap <george.dunlap@xxxxxxxxxx>
CommitDate: Fri May 29 18:53:54 2020 +0100

    xen: cpupool: add a back-pointer from a scheduler to its pool
    
    If we need to know within which pool a particular scheduler
    is working, we can do that by querying the cpupool pointer
    of any of the sched_resource-s (i.e., ~ any of the CPUs)
    assigned to the scheduler itself.
    
    Basically, we pick any sched_resource that we know uses that
    scheduler, and we check its *cpupool pointer. If we really
    know that the resource uses the scheduler, this is fine, as
    it also means the resource is inside the pool we are
    looking for.
    
    But, of course, we can't do that for a pool/scheduler that has
    not any been given any sched_resource yet (or if we do not
    know whether or not it has any sched_resource).
    
    To overcome such limitation, add a back pointer from the
    scheduler, to its own pool.
    
    Signed-off-by: Dario Faggioli <dfaggioli@xxxxxxxx>
    Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/common/sched/cpupool.c | 1 +
 xen/common/sched/private.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c
index 0664f7fa3d..7ea641ca26 100644
--- a/xen/common/sched/cpupool.c
+++ b/xen/common/sched/cpupool.c
@@ -287,6 +287,7 @@ static struct cpupool *cpupool_create(
         if ( c->sched == NULL )
             goto err;
     }
+    c->sched->cpupool = c;
     c->gran = opt_sched_granularity;
 
     *q = c;
diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h
index b9a5b4c01c..df50976eb2 100644
--- a/xen/common/sched/private.h
+++ b/xen/common/sched/private.h
@@ -275,6 +275,7 @@ struct scheduler {
     char *opt_name;         /* option name for this scheduler    */
     unsigned int sched_id;  /* ID for this scheduler             */
     void *sched_data;       /* global data pointer               */
+    struct cpupool *cpupool;/* points to this scheduler's pool   */
 
     int          (*global_init)    (void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.