V2 Allow user to configure credit scheduler parameters
PATCH 1/1 V2 Allow user to configure credit scheduler parameters
This patch series introduces hypercalls to allow the timeslice and ratelimit parameters of the credit scheduler to be read and tweaked, and plumbed all the way through to the xl command-line.
v2:
- Fixed some line-length issues
- Renamed structures and functions "params" rather than "param"
- Added options to xl man page
PATCH 1/1 cleanup: Remove dependency files in efi directory during a make clean
xen/arch/x86/Makefile +1 -1
@@ -168,5 +168,5 @@ efi/mkreloc: efi/mkreloc.c clean:: rm -f asm-offsets.s xen.lds boot/*.o boot/*~ boot/core boot/mkelf32 rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d - rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.o efi/mkreloc + rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.o efi/mkreloc efi/.*.d rm -f boot/reloc.S boot/reloc.lnk boot/reloc.bin
PATCH 1/1 xen: Add a #define for the default ratelimit
In reply to George Dunlapxen/common/schedule.c +1 -1
@@ -50,7 +50,7 @@ boolean_param("sched_smt_power_savings",/* Default scheduling rate limit: 1ms * The behavior when sched_ratelimit_us is greater than sched_credit_tslice_ms is undefined * */ -int sched_ratelimit_us =1000 ; +int sched_ratelimit_us =SCHED_DEFAULT_RATELIMIT_US ;integer_param ("sched_ratelimit_us" , sched_ratelimit_us);/* Various timer handlers. */ static void s_timer_fn (void *unused);
xen/include/xen/sched-if.h +1 -0
@@ -18,6 +18,7 @@ extern cpumask_t cpupool_free_cpus;/* Scheduler generic parameters * */ +#define SCHED_DEFAULT_RATELIMIT_US 1000extern int sched_ratelimit_us;
PATCH 1/1 xen: Print ratelimit in scheduler debugkey
In reply to George Dunlapxen/common/sched_credit.c +2 -0
@@ -1504,6 +1504,7 @@ csched_dump(const struct scheduler *ops)"\trunq_sort = %u\n" "\tdefault-weight = %d\n" "\ttslice = %dms\n" +"\tratelimit = %dus\n" "\tcredits per msec = %d\n" "\tticks per tslice = %d\n" "\tmigration delay = %uus\n",
@@ -1515,6 +1516,7 @@ csched_dump(const struct scheduler *ops) prv->runq_sort,CSCHED_DEFAULT_WEIGHT , prv->tslice_ms, + prv->ratelimit_us,CSCHED_CREDITS_PER_MSEC , prv->ticks_per_tslice, vcpu_migration_delay);
PATCH 1/1 xen: Implement SCHEDOP sysctl for credit scheduler
In reply to George DunlapAllow tslice_ms and ratelimit_us to be modified.
xen/common/sched_credit.c +53 -0
@@ -833,6 +833,36 @@ csched_dom_cntl(return 0 ; } +static int +csched_sys_cntl (const struct scheduler *ops, +struct xen_sysctl_scheduler_op *sc) +{ +int rc = -EINVAL ; +xen_sysctl_credit_schedule_t *params = &sc->u.sched_credit; +struct csched_private *prv =CSCHED_PRIV (ops); + +switch ( sc->cmd ) + { +case XEN_SYSCTL_SCHEDOP_putinfo: +if (params->tslice_ms >XEN_SYSCTL_CSCHED_TSLICE_MAX + || params->tslice_ms <XEN_SYSCTL_CSCHED_TSLICE_MIN + || params->ratelimit_us >XEN_SYSCTL_SCHED_RATELIMIT_MAX + || params->ratelimit_us <XEN_SYSCTL_SCHED_RATELIMIT_MIN + ||MICROSECS (params->ratelimit_us) >MILLISECS (params->tslice_ms) ) + goto out; + prv->tslice_ms = params->tslice_ms; + prv->ratelimit_us = params->ratelimit_us; +/* FALLTHRU */ +case XEN_SYSCTL_SCHEDOP_getinfo: + params->tslice_ms = prv->tslice_ms; + params->ratelimit_us = prv->ratelimit_us; + rc =0 ; +break ; + } + out: +return rc; +} +static void *csched_alloc_domdata (const struct scheduler *ops,struct domain *dom) {
@@ -1566,6 +1596,28 @@ csched_init(struct scheduler *ops)INIT_LIST_HEAD (&prv->active_sdom); prv->master =UINT_MAX ; +if ( sched_credit_tslice_ms >XEN_SYSCTL_CSCHED_TSLICE_MAX + || sched_credit_tslice_ms <XEN_SYSCTL_CSCHED_TSLICE_MIN ) + { +printk ("WARNING: sched_credit_tslice_ms outside of valid range [%d,%d].\n" +" Resetting to default %u\n" , +XEN_SYSCTL_CSCHED_TSLICE_MIN , +XEN_SYSCTL_CSCHED_TSLICE_MAX , +CSCHED_DEFAULT_TSLICE_MS ); + sched_credit_tslice_ms =CSCHED_DEFAULT_TSLICE_MS ; + } + +if ( sched_ratelimit_us >XEN_SYSCTL_SCHED_RATELIMIT_MAX + || sched_ratelimit_us <XEN_SYSCTL_SCHED_RATELIMIT_MIN ) + { +printk ("WARNING: sched_ratelimit_us outside of valid range [%d,%d].\n" +" Resetting to default %u\n" , +XEN_SYSCTL_SCHED_RATELIMIT_MIN , +XEN_SYSCTL_SCHED_RATELIMIT_MAX , +SCHED_DEFAULT_RATELIMIT_US ); + sched_ratelimit_us =SCHED_DEFAULT_RATELIMIT_US ; + } + prv->tslice_ms = sched_credit_tslice_ms; prv->ticks_per_tslice =CSCHED_TICKS_PER_TSLICE ;if ( prv->tslice_ms < prv->ticks_per_tslice )
@@ -1641,6 +1693,7 @@ const struct scheduler sched_credit_def .yield = csched_vcpu_yield, .adjust = csched_dom_cntl, + .adjust_global = csched_sys_cntl, .pick_cpu = csched_cpu_pick, .do_schedule = csched_schedule,
xen/include/public/sysctl.h +14 -0
@@ -564,6 +564,19 @@ struct xen_sysctl_arinc653_schedule {typedef struct xen_sysctl_arinc653_schedule xen_sysctl_arinc653_schedule_t ;DEFINE_XEN_GUEST_HANDLE (xen_sysctl_arinc653_schedule_t); +struct xen_sysctl_credit_schedule { +/* Length of timeslice in milliseconds */ +#define XEN_SYSCTL_CSCHED_TSLICE_MAX 1000 +#define XEN_SYSCTL_CSCHED_TSLICE_MIN 1 +unsigned tslice_ms; +/* Rate limit (minimum timeslice) in microseconds */ +#define XEN_SYSCTL_SCHED_RATELIMIT_MAX 500000 +#define XEN_SYSCTL_SCHED_RATELIMIT_MIN 100 +unsigned ratelimit_us; +}; +typedef struct xen_sysctl_credit_schedule xen_sysctl_credit_schedule_t ; +DEFINE_XEN_GUEST_HANDLE (xen_sysctl_credit_schedule_t); +/* XEN_SYSCTL_scheduler_op */ /* Set or get info? */ #define XEN_SYSCTL_SCHEDOP_putinfo 0
@@ -576,6 +589,7 @@ struct xen_sysctl_scheduler_op {struct xen_sysctl_sched_arinc653 {XEN_GUEST_HANDLE_64 (xen_sysctl_arinc653_schedule_t) schedule; } sched_arinc653; +struct xen_sysctl_credit_schedule sched_credit; } u; };typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t ;
PATCH 1/1 libxc: Implement SCHEDOP sysctl for credit scheduler
In reply to George Dunlaptools/libxc/xc_csched.c +44 -0
@@ -61,3 +61,47 @@ xc_sched_credit_domain_get(return err; } + +int +xc_sched_credit_params_set ( +xc_interface *xch, +uint32_t cpupool_id, +struct xen_sysctl_credit_schedule *schedule) +{ +int rc; +DECLARE_SYSCTL ; + + sysctl.cmd = XEN_SYSCTL_scheduler_op; + sysctl.u.scheduler_op.cpupool_id = cpupool_id; + sysctl.u.scheduler_op.sched_id =XEN_SCHEDULER_CREDIT ; + sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_putinfo; + + sysctl.u.scheduler_op.u.sched_credit = *schedule; + + rc =do_sysctl (xch, &sysctl); + + *schedule = sysctl.u.scheduler_op.u.sched_credit; + +return rc; +} + +int +xc_sched_credit_params_get ( +xc_interface *xch, +uint32_t cpupool_id, +struct xen_sysctl_credit_schedule *schedule) +{ +int rc; +DECLARE_SYSCTL ; + + sysctl.cmd = XEN_SYSCTL_scheduler_op; + sysctl.u.scheduler_op.cpupool_id = cpupool_id; + sysctl.u.scheduler_op.sched_id =XEN_SCHEDULER_CREDIT ; + sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_getinfo; + + rc =do_sysctl (xch, &sysctl); + + *schedule = sysctl.u.scheduler_op.u.sched_credit; + +return rc; +}
tools/libxc/xenctrl.h +6 -1
@@ -668,7 +668,12 @@ int xc_sched_credit_domain_set(xc_interfint xc_sched_credit_domain_get (xc_interface *xch,uint32_t domid,struct xen_domctl_sched_credit *sdom); - +int xc_sched_credit_params_set (xc_interface *xch, +uint32_t cpupool_id, +struct xen_sysctl_credit_schedule *schedule); +int xc_sched_credit_params_get (xc_interface *xch, +uint32_t cpupool_id, +struct xen_sysctl_credit_schedule *schedule);int xc_sched_credit2_domain_set (xc_interface *xch,uint32_t domid,struct xen_domctl_sched_credit2 *sdom);
PATCH 1/1 libxl: Rename libxl_sched_* to include _domain
In reply to George DunlapIn preparation for introducing a schedule parameter-based structure, rename libxl_sched_{credit,credit2,sedf} to libxl_sched_{}_domain.
No functional changes.
v2: Wrap long lines while I'm at it
tools/libxl/libxl.c +8 -6
@@ -2975,7 +2975,8 @@ int libxl_get_sched_id(libxl_ctx *ctx)return sched; } -int libxl_sched_credit_domain_get (libxl_ctx *ctx,uint32_t domid,libxl_sched_credit *scinfo) +int libxl_sched_credit_domain_get (libxl_ctx *ctx,uint32_t domid, +libxl_sched_credit_domain *scinfo) {struct xen_domctl_sched_credit sdom;int rc;
@@ -2992,7 +2993,8 @@ int libxl_sched_credit_domain_get(libxl_return 0 ; } -int libxl_sched_credit_domain_set (libxl_ctx *ctx,uint32_t domid,libxl_sched_credit *scinfo) +int libxl_sched_credit_domain_set (libxl_ctx *ctx,uint32_t domid, +libxl_sched_credit_domain *scinfo) {struct xen_domctl_sched_credit sdom;xc_domaininfo_t domaininfo;
@@ -3033,7 +3035,7 @@ int libxl_sched_credit_domain_set(libxl_ }int libxl_sched_credit2_domain_get (libxl_ctx *ctx,uint32_t domid, -libxl_sched_credit2 *scinfo) +libxl_sched_credit2_domain *scinfo) {struct xen_domctl_sched_credit2 sdom;int rc;
@@ -3051,7 +3053,7 @@ int libxl_sched_credit2_domain_get(libxl }int libxl_sched_credit2_domain_set (libxl_ctx *ctx,uint32_t domid, -libxl_sched_credit2 *scinfo) +libxl_sched_credit2_domain *scinfo) {struct xen_domctl_sched_credit2 sdom;xc_domaininfo_t domaininfo;
@@ -3086,7 +3088,7 @@ int libxl_sched_credit2_domain_set(libxl }int libxl_sched_sedf_domain_get (libxl_ctx *ctx,uint32_t domid, -libxl_sched_sedf *scinfo) +libxl_sched_sedf_domain *scinfo) {uint64_t period;uint64_t slice;
@@ -3112,7 +3114,7 @@ int libxl_sched_sedf_domain_get(libxl_ct }int libxl_sched_sedf_domain_set (libxl_ctx *ctx,uint32_t domid, -libxl_sched_sedf *scinfo) +libxl_sched_sedf_domain *scinfo) {xc_domaininfo_t domaininfo;int rc;
tools/libxl/libxl.h +6 -6
@@ -588,17 +588,17 @@ int libxl_get_sched_id(libxl_ctx *ctx);int libxl_sched_credit_domain_get (libxl_ctx *ctx,uint32_t domid, -libxl_sched_credit *scinfo); +libxl_sched_credit_domain *scinfo);int libxl_sched_credit_domain_set (libxl_ctx *ctx,uint32_t domid, -libxl_sched_credit *scinfo); +libxl_sched_credit_domain *scinfo);int libxl_sched_credit2_domain_get (libxl_ctx *ctx,uint32_t domid, -libxl_sched_credit2 *scinfo); +libxl_sched_credit2_domain *scinfo);int libxl_sched_credit2_domain_set (libxl_ctx *ctx,uint32_t domid, -libxl_sched_credit2 *scinfo); +libxl_sched_credit2_domain *scinfo);int libxl_sched_sedf_domain_get (libxl_ctx *ctx,uint32_t domid, -libxl_sched_sedf *scinfo); +libxl_sched_sedf_domain *scinfo);int libxl_sched_sedf_domain_set (libxl_ctx *ctx,uint32_t domid, -libxl_sched_sedf *scinfo); +libxl_sched_sedf_domain *scinfo);int libxl_send_trigger (libxl_ctx *ctx,uint32_t domid,libxl_trigger trigger,uint32_t vcpuid);int libxl_send_sysrq (libxl_ctx *ctx,uint32_t domid,char sysrq);
tools/libxl/libxl_types.idl +3 -3
@@ -390,16 +390,16 @@ libxl_cputopology = Struct("cputopology" ("node", uint32), ]) -libxl_sched_credit = Struct("sched_credit", [ +libxl_sched_credit_domain = Struct("sched_credit_domain", [ ("weight", integer), ("cap", integer), ], dispose_fn=None) -libxl_sched_credit2 = Struct("sched_credit2", [ +libxl_sched_credit2_domain = Struct("sched_credit2_domain", [ ("weight", integer), ], dispose_fn=None) -libxl_sched_sedf = Struct("sched_sedf", [ +libxl_sched_sedf_domain = Struct("sched_sedf_domain", [ ("period", integer), ("slice", integer), ("latency", integer),
tools/libxl/xl_cmdimpl.c +12 -12
@@ -3913,7 +3913,7 @@ int main_sharing(int argc, char **argv) }static int sched_credit_domain_get ( -int domid,libxl_sched_credit *scinfo) +int domid,libxl_sched_credit_domain *scinfo) {int rc;
@@ -3925,7 +3925,7 @@ static int sched_credit_domain_get( }static int sched_credit_domain_set ( -int domid,libxl_sched_credit *scinfo) +int domid,libxl_sched_credit_domain *scinfo) {int rc;
@@ -3940,7 +3940,7 @@ static int sched_credit_domain_output( int domid) {char *domname; -libxl_sched_credit scinfo; +libxl_sched_credit_domain scinfo;int rc;if (domid <0 ) {
@@ -3961,7 +3961,7 @@ static int sched_credit_domain_output( }static int sched_credit2_domain_get ( -int domid,libxl_sched_credit2 *scinfo) +int domid,libxl_sched_credit2_domain *scinfo) {int rc;
@@ -3973,7 +3973,7 @@ static int sched_credit2_domain_get( }static int sched_credit2_domain_set ( -int domid,libxl_sched_credit2 *scinfo) +int domid,libxl_sched_credit2_domain *scinfo) {int rc;
@@ -3988,7 +3988,7 @@ static int sched_credit2_domain_output( int domid) {char *domname; -libxl_sched_credit2 scinfo; +libxl_sched_credit2_domain scinfo;int rc;if (domid <0 ) {
@@ -4008,7 +4008,7 @@ static int sched_credit2_domain_output( }static int sched_sedf_domain_get ( -int domid,libxl_sched_sedf *scinfo) +int domid,libxl_sched_sedf_domain *scinfo) {int rc;
@@ -4020,7 +4020,7 @@ static int sched_sedf_domain_get( }static int sched_sedf_domain_set ( -int domid,libxl_sched_sedf *scinfo) +int domid,libxl_sched_sedf_domain *scinfo) {int rc;
@@ -4035,7 +4035,7 @@ static int sched_sedf_domain_output( int domid) {char *domname; -libxl_sched_sedf scinfo; +libxl_sched_sedf_domain scinfo;int rc;if (domid <0 ) {
@@ -4116,7 +4116,7 @@ static int sched_domain_output(int main_sched_credit (int argc,char **argv) { -libxl_sched_credit scinfo; +libxl_sched_credit_domain scinfo;const char *dom =NULL ;const char *cpupool =NULL ;int weight =256 , cap =0 , opt_w =0 , opt_c =0 ;
@@ -4198,7 +4198,7 @@ int main_sched_credit(int argc, char **aint main_sched_credit2 (int argc,char **argv) { -libxl_sched_credit2 scinfo; +libxl_sched_credit2_domain scinfo;const char *dom =NULL ;const char *cpupool =NULL ;int weight =256 , opt_w =0 ;
@@ -4272,7 +4272,7 @@ int main_sched_credit2(int argc, char **int main_sched_sedf (int argc,char **argv) { -libxl_sched_sedf scinfo; +libxl_sched_sedf_domain scinfo;const char *dom =NULL ;const char *cpupool =NULL ;int period =0 , opt_p =0 ;
tools/ocaml/libs/xl/xenlight_stubs.c +4 -4
@@ -473,7 +473,7 @@ value stub_xl_sched_credit_domain_get(va {CAMLparam1 (domid);CAMLlocal1 (scinfo); -libxl_sched_credit c_scinfo; +libxl_sched_credit_domain c_scinfo;int ret;INIT_STRUCT ();
@@ -483,18 +483,18 @@ value stub_xl_sched_credit_domain_get(vafailwith_xl ("sched_credit_domain_get" , &lg);FREE_CTX (); - scinfo =Val_sched_credit (&gc, &lg, &c_scinfo); + scinfo =Val_sched_credit_domain (&gc, &lg, &c_scinfo);CAMLreturn (scinfo); }value stub_xl_sched_credit_domain_set (value domid,value scinfo) {CAMLparam2 (domid, scinfo); -libxl_sched_credit c_scinfo; +libxl_sched_credit_domain c_scinfo;int ret;INIT_STRUCT (); -sched_credit_val (&gc, &lg, &c_scinfo, scinfo); +sched_credit_domain_val (&gc, &lg, &c_scinfo, scinfo);INIT_CTX (); ret =libxl_sched_credit_domain_set (ctx,Int_val (domid), &c_scinfo);
Re: [PATCH 6 of 9] libxl: Rename libxl_sched_* to include _domain
Quoted 6 lines · George Dunlap
In preparation for introducing a schedule parameter-based structure, rename libxl_sched_{credit,credit2,sedf} to libxl_sched_{}_domain.
No functional changes.
v2: Wrap long lines while I'm at it
I've applied up to and including this patch (since it's Acked by Ian). I leave the remaining three patches to a libxl maintainer.
-- Keir
Quoted 264 lines
Signed-off-by George Dunlap <[email protected]>Acked-by Ian Jackson <[email protected]>diff -r
b5d446a34508-raf02b1ea16datools/libxl/libxl.ctools/libxl/libxl.c Wed Feb 22 16:08:28 2012 +0000 +2
-1@@ -2975,7 +2975,8 @@ int libxl_get_sched_id(libxl_ctx *ctx) return sched; } -int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid, libxl_sched_credit *scinfo) +int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid, + libxl_sched_credit_domain *scinfo) { struct xen_domctl_sched_credit sdom;int rc;tools/libxl/libxl.c Wed Feb 22 16:08:28 2012 +0000 +2
-1@@ -2992,7 +2993,8 @@ int libxl_sched_credit_domain_get(libxl_ return 0; } -int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid, libxl_sched_credit *scinfo) +int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid, + libxl_sched_credit_domain *scinfo) { struct xen_domctl_sched_credit sdom;xc_domaininfo_t domaininfo;tools/libxl/libxl.c Wed Feb 22 16:08:28 2012 +0000 +4
-4@@ -3033,7 +3035,7 @@ int libxl_sched_credit_domain_set(libxl_ } int libxl_sched_credit2_domain_get(libxl_ctx *ctx, uint32_t domid, - libxl_sched_credit2 *scinfo) + libxl_sched_credit2_domain *scinfo) { struct xen_domctl_sched_credit2 sdom; int rc;@@ -3051,7 +3053,7 @@ int libxl_sched_credit2_domain_get(libxl } int libxl_sched_credit2_domain_set(libxl_ctx *ctx, uint32_t domid, - libxl_sched_credit2 *scinfo) + libxl_sched_credit2_domain *scinfo) { struct xen_domctl_sched_credit2 sdom; xc_domaininfo_t domaininfo;@@ -3086,7 +3088,7 @@ int libxl_sched_credit2_domain_set(libxl } int libxl_sched_sedf_domain_get(libxl_ctx *ctx, uint32_t domid, - libxl_sched_sedf *scinfo) + libxl_sched_sedf_domain *scinfo) { uint64_t period; uint64_t slice;@@ -3112,7 +3114,7 @@ int libxl_sched_sedf_domain_get(libxl_ct } int libxl_sched_sedf_domain_set(libxl_ctx *ctx, uint32_t domid, - libxl_sched_sedf *scinfo) + libxl_sched_sedf_domain *scinfo) { xc_domaininfo_t domaininfo; int rc;diff -r
b5d446a34508-raf02b1ea16datools/libxl/libxl.htools/libxl/libxl.h Wed Feb 22 16:08:28 2012 +0000 +6
-6@@ -588,17 +588,17 @@ int libxl_get_sched_id(libxl_ctx *ctx); int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid, - libxl_sched_credit *scinfo); + libxl_sched_credit_domain *scinfo); int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid, - libxl_sched_credit *scinfo); + libxl_sched_credit_domain *scinfo); int libxl_sched_credit2_domain_get(libxl_ctx *ctx, uint32_t domid, - libxl_sched_credit2 *scinfo); + libxl_sched_credit2_domain *scinfo); int libxl_sched_credit2_domain_set(libxl_ctx *ctx, uint32_t domid, - libxl_sched_credit2 *scinfo); + libxl_sched_credit2_domain *scinfo); int libxl_sched_sedf_domain_get(libxl_ctx *ctx, uint32_t domid, - libxl_sched_sedf *scinfo); + libxl_sched_sedf_domain *scinfo); int libxl_sched_sedf_domain_set(libxl_ctx *ctx, uint32_t domid, - libxl_sched_sedf *scinfo); + libxl_sched_sedf_domain *scinfo); int libxl_send_trigger(libxl_ctx *ctx, uint32_t domid, libxl_trigger trigger, uint32_t vcpuid); int libxl_send_sysrq(libxl_ctx *ctx, uint32_t domid, char sysrq);diff -r
b5d446a34508-raf02b1ea16datools/libxl/libxl_types.idltools/libxl/libxl_types.idl Wed Feb 22 16:08:28 2012 +0000 +3
-3@@ -390,16 +390,16 @@ libxl_cputopology = Struct("cputopology" ("node", uint32), ]) -libxl_sched_credit = Struct("sched_credit", [ +libxl_sched_credit_domain = Struct("sched_credit_domain", [ ("weight", integer), ("cap", integer), ], dispose_fn=None) -libxl_sched_credit2 = Struct("sched_credit2", [ +libxl_sched_credit2_domain = Struct("sched_credit2_domain", [ ("weight", integer), ], dispose_fn=None) -libxl_sched_sedf = Struct("sched_sedf", [ +libxl_sched_sedf_domain = Struct("sched_sedf_domain", [ ("period", integer), ("slice", integer), ("latency", integer),diff -r
b5d446a34508-raf02b1ea16datools/libxl/xl_cmdimpl.ctools/libxl/xl_cmdimpl.c Wed Feb 22 16:08:28 2012 +0000 +12
-12@@ -3913,7 +3913,7 @@ int main_sharing(int argc, char **argv) } static int sched_credit_domain_get( - int domid, libxl_sched_credit *scinfo) + int domid, libxl_sched_credit_domain *scinfo) { int rc;@@ -3925,7 +3925,7 @@ static int sched_credit_domain_get( } static int sched_credit_domain_set( - int domid, libxl_sched_credit *scinfo) + int domid, libxl_sched_credit_domain *scinfo) { int rc;@@ -3940,7 +3940,7 @@ static int sched_credit_domain_output( int domid) { char *domname; - libxl_sched_credit scinfo; + libxl_sched_credit_domain scinfo; int rc; if (domid < 0) {@@ -3961,7 +3961,7 @@ static int sched_credit_domain_output( } static int sched_credit2_domain_get( - int domid, libxl_sched_credit2 *scinfo) + int domid, libxl_sched_credit2_domain *scinfo) { int rc;@@ -3973,7 +3973,7 @@ static int sched_credit2_domain_get( } static int sched_credit2_domain_set( - int domid, libxl_sched_credit2 *scinfo) + int domid, libxl_sched_credit2_domain *scinfo) { int rc;@@ -3988,7 +3988,7 @@ static int sched_credit2_domain_output( int domid) { char *domname; - libxl_sched_credit2 scinfo; + libxl_sched_credit2_domain scinfo; int rc; if (domid < 0) {@@ -4008,7 +4008,7 @@ static int sched_credit2_domain_output( } static int sched_sedf_domain_get( - int domid, libxl_sched_sedf *scinfo) + int domid, libxl_sched_sedf_domain *scinfo) { int rc;@@ -4020,7 +4020,7 @@ static int sched_sedf_domain_get( } static int sched_sedf_domain_set( - int domid, libxl_sched_sedf *scinfo) + int domid, libxl_sched_sedf_domain *scinfo) { int rc;@@ -4035,7 +4035,7 @@ static int sched_sedf_domain_output( int domid) { char *domname; - libxl_sched_sedf scinfo; + libxl_sched_sedf_domain scinfo; int rc; if (domid < 0) {@@ -4116,7 +4116,7 @@ static int sched_domain_output( int main_sched_credit(int argc, char **argv) { - libxl_sched_credit scinfo; + libxl_sched_credit_domain scinfo; const char *dom = NULL; const char *cpupool = NULL; int weight = 256, cap = 0, opt_w = 0, opt_c = 0;@@ -4198,7 +4198,7 @@ int main_sched_credit(int argc, char **a int main_sched_credit2(int argc, char **argv) { - libxl_sched_credit2 scinfo; + libxl_sched_credit2_domain scinfo; const char *dom = NULL; const char *cpupool = NULL; int weight = 256, opt_w = 0;@@ -4272,7 +4272,7 @@ int main_sched_credit2(int argc, char ** int main_sched_sedf(int argc, char **argv) { - libxl_sched_sedf scinfo; + libxl_sched_sedf_domain scinfo; const char *dom = NULL; const char *cpupool = NULL; int period = 0, opt_p = 0;diff -r
b5d446a34508-raf02b1ea16datools/ocaml/libs/xl/xenlight_stubs.ctools/ocaml/libs/xl/xenlight_stubs.c Wed Feb 22 16:08:28 2012 +0000 +4
-4@@ -473,7 +473,7 @@ value stub_xl_sched_credit_domain_get(va { CAMLparam1(domid); CAMLlocal1(scinfo); - libxl_sched_credit c_scinfo; + libxl_sched_credit_domain c_scinfo; int ret; INIT_STRUCT();@@ -483,18 +483,18 @@ value stub_xl_sched_credit_domain_get(va failwith_xl("sched_credit_domain_get", &lg); FREE_CTX(); - scinfo = Val_sched_credit(&gc, &lg, &c_scinfo); + scinfo = Val_sched_credit_domain(&gc, &lg, &c_scinfo); CAMLreturn(scinfo); } value stub_xl_sched_credit_domain_set(value domid, value scinfo) { CAMLparam2(domid, scinfo); - libxl_sched_credit c_scinfo; + libxl_sched_credit_domain c_scinfo; int ret; INIT_STRUCT(); - sched_credit_val(&gc, &lg, &c_scinfo, scinfo); + sched_credit_domain_val(&gc, &lg, &c_scinfo, scinfo); INIT_CTX(); ret = libxl_sched_credit_domain_set(ctx, Int_val(domid), &c_scinfo);_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
PATCH 1/1 libxl: Implement libxl_sched_credit_param_[gs]et
In reply to George DunlapImplement functions to set credit scheduler global parameters.
v2:
- Use "params" rather than "param"
- Fix long lines
tools/libxl/libxl.c +61 -0
@@ -3034,6 +3034,67 @@ int libxl_sched_credit_domain_set(libxl_return 0 ; } +int libxl_sched_credit_params_get (libxl_ctx *ctx,uint32_t poolid, +libxl_sched_credit_params *scinfo) +{ +struct xen_sysctl_credit_schedule sparam; +int rc; + + rc =xc_sched_credit_params_get (ctx->xch, poolid, &sparam); +if (rc !=0 ) { +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"getting sched credit param" ); +return ERROR_FAIL ; + } + + scinfo->tslice_ms = sparam.tslice_ms; + scinfo->ratelimit_us = sparam.ratelimit_us; + +return 0 ; +} + +int libxl_sched_credit_params_set (libxl_ctx *ctx,uint32_t poolid, +libxl_sched_credit_params *scinfo) +{ +struct xen_sysctl_credit_schedule sparam; +int rc=0 ; + +if (scinfo->tslice_ms <XEN_SYSCTL_CSCHED_TSLICE_MIN + || scinfo->tslice_ms >XEN_SYSCTL_CSCHED_TSLICE_MAX ) { +LIBXL__LOG (ctx,LIBXL__LOG_ERROR , +"Time slice out of range, valid range is from %d to %d" , +XEN_SYSCTL_CSCHED_TSLICE_MIN , +XEN_SYSCTL_CSCHED_TSLICE_MAX ); +return ERROR_INVAL ; + } +if (scinfo->ratelimit_us <XEN_SYSCTL_SCHED_RATELIMIT_MIN + || scinfo->ratelimit_us >XEN_SYSCTL_SCHED_RATELIMIT_MAX ) { +LIBXL__LOG (ctx,LIBXL__LOG_ERROR , +"Ratelimit out of range, valid range is from %d to %d" , +XEN_SYSCTL_SCHED_RATELIMIT_MIN , +XEN_SYSCTL_SCHED_RATELIMIT_MAX ); +return ERROR_INVAL ; + } +if (scinfo->ratelimit_us > scinfo->tslice_ms*1000 ) { +LIBXL__LOG (ctx,LIBXL__LOG_ERROR , +"Ratelimit cannot be greater than timeslice\n" ); +return ERROR_INVAL ; + } + + sparam.tslice_ms = scinfo->tslice_ms; + sparam.ratelimit_us = scinfo->ratelimit_us; + + rc =xc_sched_credit_params_set (ctx->xch, poolid, &sparam); +if ( rc <0 ) { +LIBXL__LOG_ERRNO (ctx,LIBXL__LOG_ERROR ,"setting sched credit param" ); +return ERROR_FAIL ; + } + + scinfo->tslice_ms = sparam.tslice_ms; + scinfo->ratelimit_us = sparam.ratelimit_us; + +return 0 ; +} +int libxl_sched_credit2_domain_get (libxl_ctx *ctx,uint32_t domid,libxl_sched_credit2_domain *scinfo) {
tools/libxl/libxl.h +4 -0
@@ -591,6 +591,10 @@ int libxl_sched_credit_domain_get(libxl_ libxl_sched_credit_domain *scinfo);int libxl_sched_credit_domain_set (libxl_ctx *ctx,uint32_t domid,libxl_sched_credit_domain *scinfo); +int libxl_sched_credit_params_get (libxl_ctx *ctx,uint32_t poolid, +libxl_sched_credit_params *scinfo); +int libxl_sched_credit_params_set (libxl_ctx *ctx,uint32_t poolid, +libxl_sched_credit_params *scinfo);int libxl_sched_credit2_domain_get (libxl_ctx *ctx,uint32_t domid,libxl_sched_credit2_domain *scinfo); int libxl_sched_credit2_domain_set(libxl_ctx *ctx, uint32_t domid,
tools/libxl/libxl_types.idl +5 -0
@@ -395,6 +395,11 @@ libxl_sched_credit_domain = Struct("sche ("cap", integer), ], dispose_fn=None) +libxl_sched_credit_params = Struct("sched_credit_params", [ + ("tslice_ms", integer), + ("ratelimit_us", integer), + ], dispose_fn=None) + libxl_sched_credit2_domain = Struct("sched_credit2_domain", [ ("weight", integer), ], dispose_fn=None)
Re: [PATCH 7 of 9] libxl: Implement libxl_sched_credit_param_[gs]et
George Dunlap writes ("[Xen-devel] [PATCH 7 of 9] libxl: Implement libxl_sched_credit_param_[gs]et"):
Quoted 1 line
Implement functions to set credit scheduler global parameters.
PATCH 1/1 xl: Refactor sched_domain_output to have a callback for pool information
In reply to George DunlapAllow a scheduler to provide a callback to display pool-wide information, providing a default. This is in preparation for displaying pool-wide scheduler parameters on this line.
tools/libxl/xl_cmdimpl.c +23 -9
@@ -4059,13 +4059,23 @@ static int sched_sedf_domain_output(return 0 ; } -static int sched_domain_output ( -uint32_t sched,int (*output)(int ),const char *cpupool) +static int sched_default_pool_output (uint32_t poolid) +{ +char *poolname; + + poolname =libxl_cpupoolid_to_name (ctx, poolid); +printf ("Cpupool %s:\n" , + poolname); +free (poolname); +return 0 ; +} + +static int sched_domain_output (uint32_t sched,int (*output)(int ), +int (*pooloutput)(uint32_t ),const char *cpupool) {libxl_dominfo *info;libxl_cpupoolinfo *poolinfo =NULL ;uint32_t poolid; -char *poolname;int nb_domain, n_pools =0 , i, p;int rc =0 ;
@@ -4093,9 +4103,7 @@ static int sched_domain_output( (cpupool && (poolid != poolinfo[p].poolid)))continue ; - poolname =libxl_cpupoolid_to_name (ctx, poolinfo[p].poolid); -printf ("Cpupool %s:\n" , poolname); -free (poolname); +pooloutput (poolinfo[p].poolid);output (-1 );for (i =0 ; i < nb_domain; i++) {
@@ -4171,7 +4179,9 @@ int main_sched_credit(int argc, char **aif (!dom) {/* list all domain's credit scheduler info */ return -sched_domain_output (XEN_SCHEDULER_CREDIT , - sched_credit_domain_output, cpupool); + sched_credit_domain_output, + sched_default_pool_output, + cpupool); }else {find_domain (dom);
@@ -4247,7 +4257,9 @@ int main_sched_credit2(int argc, char **if (!dom) {/* list all domain's credit scheduler info */ return -sched_domain_output (XEN_SCHEDULER_CREDIT2 , - sched_credit2_domain_output, cpupool); + sched_credit2_domain_output, + sched_default_pool_output, + cpupool); }else {find_domain (dom);
@@ -4349,7 +4361,9 @@ int main_sched_sedf(int argc, char **argif (!dom) {/* list all domain's credit scheduler info */ return -sched_domain_output (XEN_SCHEDULER_SEDF , - sched_sedf_domain_output, cpupool); + sched_sedf_domain_output, + sched_default_pool_output, + cpupool); }else {find_domain (dom);
Re: [PATCH 8 of 9] xl: Refactor sched_domain_output to have a callback for pool information
George Dunlap writes ("[Xen-devel] [PATCH 8 of 9] xl: Refactor sched_domain_output to have a callback for pool information"):
Quoted 3 lines
Allow a scheduler to provide a callback to display pool-wide information, providing a default. This is in preparation for displaying pool-wide scheduler parameters on this line.
I'm afraid this needs a refresh.
Ian.
PATCH 1/1 xl: Implement sched-credit schedule parameter command-line interface
In reply to George DunlapAdd features to the sched-credit interface to allow querying and displaying scheduler parameters.
v2:
- Change function line breaks
- Pool output deals gracefully with other schedulers
- Add new parameters, as well as a description of how they interact, to the xl man page
docs/man/xl.pod.1 +47 -0
@@ -714,6 +714,53 @@ no upper cap. Restrict output to domains in the specified cpupool. +=item B<-s>, B<--schedparam> + +Specify to list or set pool-wide scheduler parameters. + +=item B<-t TSLICE>, B<--tslice_ms=TSLICE> + +Timeslice tells the scheduler how long to allow VMs to run before +pre-empting. The default is 30ms. Valid ranges are 1ms to 1000ms. +The length of the timeslice (in ms) must be higher than the length of +the ratelimit (see below). + +=item B<-r RLIMIT>, B<--ratelimit_us=RLIMIT> + +Ratelimit attempts to limit the number of schedules per second. It +sets a minimum amount of time (in microseconds) a VM must run before +we will allow a higher-prioirty VM to pre-empt it. The default value +is 1000 microseconds (1ms). Valid range is 100 to 500000 (500ms). +The ratelimit length must be lower than the timeslice length. + +=back + +B<COMBINATION> + +The following is the effect of combining the above options: + +=over 4 + +=item B<E<lt>nothingE<gt>> : List all domain params and sched params from all pools + +=item B<-d [domid]> : List domain params for domain [domid] + +=item B<-d [domid] [params]> : Set domain params for domain [domid] + +=item B<-p [pool]> : list all domains and sched params for [pool] + +=item B<-s> : List sched params for poolid 0 + +=item B<-s [params]> : Set sched params for poolid 0 + +=item B<-p [pool] -s> : List sched params for [pool] + +=item B<-p [pool] -s [params]> : Set sched params for [pool] + +=item B<-p [pool] -d>... : Illegal + +=item + =back =item B<sched-credit2> [I<OPTIONS>]
tools/libxl/xl_cmdimpl.c +114 -13
195 lines not on this page · raw message
tools/libxl/xl_cmdtable.c +8 -5
@@ -204,11 +204,14 @@ struct cmd_spec cmd_table[] = { {"sched-credit" , &main_sched_credit,0 ,"Get/set credit scheduler parameters" , -"[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-p CPUPOOL]" , -"-d DOMAIN, --domain=DOMAIN Domain to modify\n" -"-w WEIGHT, --weight=WEIGHT Weight (int)\n" -"-c CAP, --cap=CAP Cap (int)\n" -"-p CPUPOOL, --cpupool=CPUPOOL Restrict output to CPUPOOL" +"[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-s [-t TSLICE] [-r RATELIMIT]] [-p CPUPOOL]" , +"-d DOMAIN, --domain=DOMAIN Domain to modify\n" +"-w WEIGHT, --weight=WEIGHT Weight (int)\n" +"-c CAP, --cap=CAP Cap (int)\n" +"-s --schedparam Query / modify scheduler parameters\n" +"-t TSLICE, --tslice_ms=TSLICE Set the timeslice, in milliseconds\n" +"-r RLIMIT, --ratelimit_us=RLIMIT Set the scheduling rate limit, in microseconds\n" +"-p CPUPOOL, --cpupool=CPUPOOL Restrict output to CPUPOOL" }, { "sched-credit2", &main_sched_credit2, 0,
Re: [PATCH 9 of 9] xl: Implement sched-credit schedule parameter command-line interface
Quoted 8 lines · George Dunlap
Add features to the sched-credit interface to allow querying and displaying scheduler parameters.
v2:
- Change function line breaks
- Pool output deals gracefully with other schedulers
- Add new parameters, as well as a description of how they interact, to the xl man page
BTW, there was a brief suggestion that rather than sharing the same command (which requires a big table to explain how the various options interact), we break out sched-credit into two, possibly three commands; one of which would read all scheduler information, the other two which would specifically get or set domain and scheduler-wide parameters. Any thoughts on this?
-G
Quoted 293 lines
Signed-off-by George Dunlap <[email protected]>diff -r
5600db2bcd0e-r0f91ce7b095adocs/man/xl.pod.1docs/man/xl.pod.1 Wed Feb 22 16:08:28 2012 +0000 +0
-0@@ -714,6 +714,53 @@ no upper cap.Restrict output to domains in the specified cpupool.
+=item B<-s>, B<--schedparam>
docs/man/xl.pod.1 Wed Feb 22 16:08:28 2012 +0000 +46
-0+ +Specify to list or set pool-wide scheduler parameters. + +=item B<-t TSLICE>, B<--tslice_ms=TSLICE> + +Timeslice tells the scheduler how long to allow VMs to run before +pre-empting. The default is 30ms. Valid ranges are 1ms to 1000ms. +The length of the timeslice (in ms) must be higher than the length of +the ratelimit (see below). + +=item B<-r RLIMIT>, B<--ratelimit_us=RLIMIT> + +Ratelimit attempts to limit the number of schedules per second. It +sets a minimum amount of time (in microseconds) a VM must run before +we will allow a higher-prioirty VM to pre-empt it. The default value +is 1000 microseconds (1ms). Valid range is 100 to 500000 (500ms). +The ratelimit length must be lower than the timeslice length. + +=back + +B<COMBINATION> + +The following is the effect of combining the above options: + +=over 4 + +=item B<E<lt>nothingE<gt>> : List all domain params and sched params from all pools + +=item B<-d [domid]> : List domain params for domain [domid] + +=item B<-d [domid] [params]> : Set domain params for domain [domid] + +=item B<-p [pool]> : list all domains and sched params for [pool] + +=item B<-s> : List sched params for poolid 0 + +=item B<-s [params]> : Set sched params for poolid 0 + +=item B<-p [pool] -s> : List sched params for [pool] + +=item B<-p [pool] -s [params]> : Set sched params for [pool] + +=item B<-p [pool] -d>... : Illegal + +=item +=back
=item B<sched-credit2> [I<OPTIONS>]
diff -r5600db2bcd0e-r0f91ce7b095atools/libxl/xl_cmdimpl.ctools/libxl/xl_cmdimpl.c Wed Feb 22 16:08:28 2012 +0000 +46
-6@@ -3912,8 +3912,7 @@ int main_sharing(int argc, char **argv) return 0; } -static int sched_credit_domain_get( - int domid, libxl_sched_credit_domain *scinfo) +static int sched_credit_domain_get(int domid, libxl_sched_credit_domain *scinfo) { int rc;@@ -3924,8 +3923,7 @@ static int sched_credit_domain_get( return rc; } -static int sched_credit_domain_set( - int domid, libxl_sched_credit_domain *scinfo) +static int sched_credit_domain_set(int domid, libxl_sched_credit_domain *scinfo) { int rc;@@ -3936,8 +3934,29 @@ static int sched_credit_domain_set( return rc; } -static int sched_credit_domain_output( - int domid) +static int sched_credit_params_set(int poolid, libxl_sched_credit_params *scinfo) +{ + int rc; + + rc = libxl_sched_credit_params_set(ctx, poolid, scinfo); + if (rc) + fprintf(stderr, "libxl_sched_credit_params_set failed.\n"); + + return rc; +} + +static int sched_credit_params_get(int poolid, libxl_sched_credit_params *scinfo) +{ + int rc; + + rc = libxl_sched_credit_params_get(ctx, poolid, scinfo); + if (rc) + fprintf(stderr, "libxl_sched_credit_params_get failed.\n"); + + return rc; +} + +static int sched_credit_domain_output(int domid) { char *domname; libxl_sched_credit_domain scinfo;@@ -3960,6 +3979,27 @@ static int sched_credit_domain_output( return 0; } +static int sched_credit_pool_output(uint32_t poolid) +{ + libxl_sched_credit_params scparam; + char *poolname; + int rc; + + poolname = libxl_cpupoolid_to_name(ctx, poolid); + rc = sched_credit_params_get(poolid, &scparam); + if (rc) { + printf("Cpupool %s: [sched params unavailable]\n", + poolname); + } else { + printf("Cpupool %s: tslice=%dms ratelimit=%dus\n", + poolname, + scparam.tslice_ms, + scparam.ratelimit_us); + } + free(poolname); + return 0; +} +static int sched_credit2_domain_get(
int domid,libxl_sched_credit2_domain*scinfo) {tools/libxl/xl_cmdimpl.c Wed Feb 22 16:08:28 2012 +0000 +28
-1@@ -4122,25 +4162,41 @@ static int sched_domain_output(uint32_t return 0; } +/* + * <nothing> : List all domain params and sched params from all pools + * -d [domid] : List domain params for domain + * -d [domid] [params] : Set domain params for domain + * -p [pool] : list all domains and sched params for pool + * -s : List sched params for poolid 0 + * -s [params] : Set sched params for poolid 0 + * -p [pool] -s : List sched params for pool + * -p [pool] -s [params] : Set sched params for pool + * -p [pool] -d... : Illegal + */ int main_sched_credit(int argc, char **argv) { libxl_sched_credit_domain scinfo; const char *dom = NULL; const char *cpupool = NULL; int weight = 256, cap = 0, opt_w = 0, opt_c = 0; + int opt_s = 0; + int tslice = 0, opt_t = 0, ratelimit = 0, opt_r = 0; int opt, rc; int option_index = 0; static struct option long_options[] = { {"domain", 1, 0, 'd'}, {"weight", 1, 0, 'w'}, {"cap", 1, 0, 'c'}, + {"schedparam", 0, 0, 's'}, + {"tslice_ms", 1, 0, 't'}, + {"ratelimit_us", 1, 0, 'r'}, {"cpupool", 1, 0, 'p'}, {"help", 0, 0, 'h'}, {0, 0, 0, 0} }; while (1) { - opt = getopt_long(argc, argv, "d:w:c:p:h", long_options, + opt = getopt_long(argc, argv, "d:w:c:p:t:r:hs", long_options, &option_index); if (opt == -1) break;@@ -4158,6 +4214,17 @@ int main_sched_credit(int argc, char **a cap = strtol(optarg, NULL, 10); opt_c = 1; break; + case 't': + tslice = strtol(optarg, NULL, 10); + opt_t = 1; + break; + case 'r': + ratelimit = strtol(optarg, NULL, 10); + opt_r = 1; + break; + case 's': + opt_s = 1; + break;case 'p':
cpupool = optarg;
break;tools/libxl/xl_cmdimpl.c Wed Feb 22 16:08:28 2012 +0000 +40
-6@@ -4167,20 +4234,54 @@ int main_sched_credit(int argc, char **a } } - if (cpupool && (dom || opt_w || opt_c)) { - fprintf(stderr, "Specifying a cpupool is not allowed with other " - "options.\n"); + if ((cpupool || opt_s) && (dom || opt_w || opt_c)) { + fprintf(stderr, "Specifying a cpupool or schedparam is not " + "allowed with domain options.\n"); return 1; } if (!dom && (opt_w || opt_c)) { fprintf(stderr, "Must specify a domain.\n"); return 1; } - - if (!dom) { /* list all domain's credit scheduler info */ + if (!opt_s && (opt_t || opt_r)) { + fprintf(stderr, "Must specify schedparam to set schedule " + "parameter values.\n"); + return 1; + } + + if (opt_s) { + libxl_sched_credit_params scparam; + uint32_t poolid = 0; + + if (cpupool) { + if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) || + !libxl_cpupoolid_to_name(ctx, poolid)) { + fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool); + return -ERROR_FAIL; + } + } + + if (!opt_t && !opt_r) { /* Output scheduling parameters */ + return -sched_credit_pool_output(poolid); + } else { /* Set scheduling parameters*/ + rc = sched_credit_params_get(poolid, &scparam); + if (rc) + return -rc; + + if (opt_t) + scparam.tslice_ms = tslice; + + if (opt_r) + scparam.ratelimit_us = ratelimit; + + rc = sched_credit_params_set(poolid, &scparam); + if (rc) + return -rc; + } + } else if (!dom) { /* list all domain's credit scheduler info */ return -sched_domain_output(XEN_SCHEDULER_CREDIT, sched_credit_domain_output, - sched_default_pool_output, + sched_credit_pool_output, cpupool); } else { find_domain(dom);diff -r
5600db2bcd0e-r0f91ce7b095atools/libxl/xl_cmdtable.ctools/libxl/xl_cmdtable.c Wed Feb 22 16:08:28 2012 +0000 +8
-5@@ -204,11 +204,14 @@ struct cmd_spec cmd_table[] = { { "sched-credit", &main_sched_credit, 0, "Get/set credit scheduler parameters", - "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-p CPUPOOL]", - "-d DOMAIN, --domain=DOMAIN Domain to modify\n" - "-w WEIGHT, --weight=WEIGHT Weight (int)\n" - "-c CAP, --cap=CAP Cap (int)\n" - "-p CPUPOOL, --cpupool=CPUPOOL Restrict output to CPUPOOL" + "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-s [-t TSLICE] [-r RATELIMIT]] [-p CPUPOOL]", + "-d DOMAIN, --domain=DOMAIN Domain to modify\n" + "-w WEIGHT, --weight=WEIGHT Weight (int)\n" + "-c CAP, --cap=CAP Cap (int)\n" + "-s --schedparam Query / modify scheduler parameters\n" + "-t TSLICE, --tslice_ms=TSLICE Set the timeslice, in milliseconds\n" + "-r RLIMIT, --ratelimit_us=RLIMIT Set the scheduling rate limit, in microseconds\n" + "-p CPUPOOL, --cpupool=CPUPOOL Restrict output to CPUPOOL" }, { "sched-credit2", &main_sched_credit2, 0,_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH 9 of 9] xl: Implement sched-credit schedule parameter command-line interface
George Dunlap writes ("Re: [Xen-devel] [PATCH 9 of 9] xl: Implement sched-credit schedule parameter command-line interface"):
Quoted 11 lines
Quoted 8 lines · George Dunlap
Add features to the sched-credit interface to allow querying and displaying scheduler parameters.
v2:
- Change function line breaks
- Pool output deals gracefully with other schedulers
- Add new parameters, as well as a description of how they interact, to the xl man page
Quoted 6 lines
BTW, there was a brief suggestion that rather than sharing the same command (which requires a big table to explain how the various options interact), we break out sched-credit into two, possibly three commands; one of which would read all scheduler information, the other two which would specifically get or set domain and scheduler-wide parameters. Any thoughts on this?
That would be fine by me. I don't think we have a big established user base.
Ian.