[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 08/60] xen/sched: introduce struct sched_resource
On Tue, 2019-05-28 at 12:32 +0200, Juergen Gross wrote: > Add a scheduling abstraction layer between physical processors and > the > schedulers by introducing a struct sched_resource. Each scheduler > unit > running is active on such a scheduler resource. For the time being > there is one struct sched_resource per cpu, but in future there might > be one for each core or socket only. > I only have two questions: > @@ -1618,6 +1623,13 @@ static int cpu_schedule_up(unsigned int cpu) > { > struct schedule_data *sd = &per_cpu(schedule_data, cpu); > void *sched_priv; > + struct sched_resource *res; > + > + res = xzalloc(struct sched_resource); > + if ( res == NULL ) > + return -ENOMEM; > + res->processor = cpu; > + set_sched_res(cpu, res); > > per_cpu(scheduler, cpu) = &ops; > spin_lock_init(&sd->_lock); > @@ -1682,6 +1694,9 @@ static void cpu_schedule_down(unsigned int cpu) > sd->sched_priv = NULL; > > kill_timer(&sd->s_timer); > + > + set_sched_res(cpu, NULL); > + xfree(sd); > } > What's that xfree(sd) about? > @@ -334,7 +349,10 @@ static inline void sched_migrate(const struct > scheduler *s, > if ( s->migrate ) > s->migrate(s, unit, cpu); > else > + { > unit->vcpu->processor = cpu; > + unit->res = per_cpu(sched_res, cpu); > + } > unit->res = get_sched_res(cpu) ? Regards -- Dario Faggioli, Ph.D http://about.me/dario.faggioli Virtualization Software Engineer SUSE Labs, SUSE https://www.suse.com/ ------------------------------------------------------------------- <<This happens because _I_ choose it to happen!>> (Raistlin Majere) Attachment:
signature.asc _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |