On 31/05/2019 17:52, Dario Faggioli wrote: > On Tue, 2019-05-28 at 12:33 +0200, Juergen Gross wrote: >> Instead of having a full blown scheduler running for the free cpus >> add a very minimalistic scheduler for that purpose only ever >> scheduling >> the related idle vcpu. This has the big advantage of not needing any >> per-cpu, per-domain or per-scheduling unit data for free cpus and in >> turn simplifying moving cpus to and from cpupools a lot. >> >> As this new scheduler is not user selectable don't register it as an >> official scheduler, but just include it in schedule.c. >> >> Signed-off-by: Juergen Gross <jgr...@suse.com> >> --- >> V1: new patch >> --- > >> --- a/xen/common/schedule.c >> +++ b/xen/common/schedule.c >> @@ -83,6 +83,57 @@ extern const struct scheduler >> *__start_schedulers_array[], *__end_schedulers_arr >> >> static struct scheduler __read_mostly ops; >> >> [...] >> >> +static void * >> +sched_idle_alloc_vdata(const struct scheduler *ops, struct >> sched_unit *unit, >> + void *dd) >> +{ >> + /* Any non-NULL pointer is fine here. */ >> + return (void *)1UL; >> +} >> + > I think the proper thing to do, here, would be to convert alloc_vdata() > to PTR_ERR() & IS_ERR(). > > That's another patch, of course, and given that this series is rather > big already, I'm not sure about asking for it to be done in the context > of this work. > > I can do it myself, either right now or after this series is merged > (for the sake of not making rebasing 60 patches more complicated than > it must be already, for you :-D). > > Let me know what you think.
There is only one place left where alloc_vdata is being called for the idle scheduler, and that is sched_init_vcpu() of an idle vcpu. I have planned to do a followup series cleaning up the scheduling stuff where I can add a patch special casing that and removing sched_idle_alloc_vdata(). Juergen _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel