Each struct scheduler currently doubles as both a scheduler
backend's static vtable (name, opt_name, sched_id and every
function pointer) and the per-cpupool runtime object that
scheduler_alloc() allocates. Because these are the same type,
scheduler_alloc() memcpy()s the entire vtable into a fresh heap
allocation for every cpupool it creates. With N cpupools running
the same scheduler, this duplicates N copies of identical function
pointers and identifying fields that never differ between
instances - the only fields that are genuinely per-cpupool are
sched_data and cpupool.
This series splits the vtable out into its own type, struct
sched_ops, so it can be shared by every cpupool using a given
scheduler instead of copied per cpupool. struct scheduler is left
holding only what is actually per-instance: a pointer to the
shared sched_ops, plus sched_data and cpupool.
Patch 1 contains the whole functional change: struct sched_ops is
introduced, every in-tree scheduler backend is converted to it,
and struct scheduler is shrunk accordingly.
Patch 2 is a pure rename of the symbols to match the new sched_ops.
v2: folded the previous 7-patch series into two patches.
Furkan Caliskan (2):
xen/sched: split scheduler vtable from struct scheduler
xen/sched: rename scheduler registration symbols
xen/arch/arm/xen.lds.S | 2 +-
xen/arch/ppc/xen.lds.S | 2 +-
xen/arch/riscv/xen.lds.S | 2 +-
xen/arch/x86/xen.lds.S | 2 +-
xen/common/sched/arinc653.c | 11 +---
xen/common/sched/core.c | 81 ++++++++++++++++-------------
xen/common/sched/cpupool.c | 7 +--
xen/common/sched/credit.c | 5 +-
xen/common/sched/credit2.c | 5 +-
xen/common/sched/null.c | 5 +-
xen/common/sched/private.h | 100 +++++++++++++++++++-----------------
xen/common/sched/rt.c | 5 +-
xen/include/xen/xen.lds.h | 10 ++--
13 files changed, 119 insertions(+), 118 deletions(-)
--
2.34.1