sched: implement .init_pdata in Credit, Credit2 and RTDS
authorDario Faggioli <dario.faggioli@citrix.com>
Thu, 7 Apr 2016 22:03:03 +0000 (00:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 7 Apr 2016 22:03:03 +0000 (00:03 +0200)
commit64269d936584c29de951c6613bf618640832b9a6
tree1df3f2b40b120a945b79fd1fe311b1d0e5789873
parent05ea4efc222023a1720503a6252fc5f30448bf0a
sched: implement .init_pdata in Credit, Credit2 and RTDS

In fact, if a scheduler needs per-pCPU information,
that needs to be initialized appropriately. So, we take
the code that is performing initializations from (right
now) .alloc_pdata, and use it for .init_pdata, leaving
only actualy allocations in the former, if any (which
is the case in RTDS and Credit1).

On the other hand, in Credit2, since we don't really
need any per-pCPU data allocation, everything that was
being done in .alloc_pdata, is now done in .init_pdata.
And the fact that now .alloc_pdata can be left undefined,
allows us to just get rid of it.

Still for Credit2, the fact that .init_pdata is called
during CPU_STARTING (rather than CPU_UP_PREPARE) kills
the need for the scheduler to setup a similar callback
itself, simplifying the code.

And thanks to such simplification, it is now also ok to
move some of the logic meant at double checking that a
cpu was (or was not) initialized, into ASSERTS (rather
than an if() and a BUG_ON).

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Meng Xu <mengxu@cis.upenn.edu>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
xen/common/sched_credit.c
xen/common/sched_credit2.c
xen/common/sched_rt.c