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@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
Dario Faggioli authored and George Dunlap committed 2020-05-29 18:53:54 +01:00
1 parent c963db8d18
commit 524cc89c28
2 files changed
+2

No files matched your search

+1
View File
@@ -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;
+1
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.