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>
if ( c->sched == NULL )
goto err;
}
+ c->sched->cpupool = c;
c->gran = opt_sched_granularity;
*q = c;
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);