sched: make implementing .alloc_pdata optional
authorDario Faggioli <dario.faggioli@citrix.com>
Thu, 7 Apr 2016 22:01:49 +0000 (00:01 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 7 Apr 2016 22:01:49 +0000 (00:01 +0200)
commit05ea4efc222023a1720503a6252fc5f30448bf0a
treee6f130f16fb0638944e54b61e969ac0ccaf25e9f
parentc63a6ee79cbe45b8f8092543a110361a66d50ca9
sched: make implementing .alloc_pdata optional

The .alloc_pdata scheduler hook must, before this change,
be implemented by all schedulers --even those ones that
don't need to allocate anything.

Make it possible to just use the SCHED_OP(), like for
the other hooks, by using ERR_PTR() and IS_ERR() for
error reporting. This:
 - makes NULL a variant of success;
 - allows for errors other than ENOMEM to be properly
   communicated (if ever necessary).

This, in turn, means that schedulers not needing to
allocate any per-pCPU data, can avoid implementing the
hook. In fact, the artificial implementation of
.alloc_pdata in the ARINC653 is removed (and, while there,
nuke .free_pdata too, as it is equally useless).

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