Message ID | 1505177142-14864-2-git-send-email-anshulmakkar@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 12/09/17 02:45, anshulmakkar wrote: > libxc receives scheduler specific configuration parametes from > libxl. > > Signed-off-by: Anshul Makkar <anshulmakkar@gmail.com> > --- > tools/libxc/include/xenctrl.h | 6 +++++- > tools/libxc/xc_cpupool.c | 4 +++- > tools/python/xen/lowlevel/xc/xc.c | 3 ++- > 3 files changed, 10 insertions(+), 3 deletions(-) > > diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h > index 43151cb..e2157e9 100644 > --- a/tools/libxc/include/xenctrl.h > +++ b/tools/libxc/include/xenctrl.h > @@ -1077,17 +1077,21 @@ typedef struct xc_cpupoolinfo { > > #define XC_CPUPOOL_POOLID_ANY 0xFFFFFFFF > > +typedef xen_sysctl_sched_param_t xc_schedparam_t; > + > /** > * Create a new cpupool. > * > * @parm xc_handle a handle to an open hypervisor interface > * @parm ppoolid pointer to the new cpupool id (in/out) > * @parm sched_id id of scheduler to use for pool > + * @parm sched_param parameter of the scheduler of the cpupool eg. runq for credit2 I would drop "eg. runq for credit2" > * return 0 on success, -1 on failure > */ > int xc_cpupool_create(xc_interface *xch, > uint32_t *ppoolid, > - uint32_t sched_id); > + uint32_t sched_id, > + xc_schedparam_t * sched_param); > > /** > * Destroy a cpupool. Pool must be unused and have no cpu assigned. > diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c > index fbd8cc9..fb2d183 100644 > --- a/tools/libxc/xc_cpupool.c > +++ b/tools/libxc/xc_cpupool.c > @@ -36,7 +36,8 @@ static int do_sysctl_save(xc_interface *xch, struct xen_sysctl *sysctl) > > int xc_cpupool_create(xc_interface *xch, > uint32_t *ppoolid, > - uint32_t sched_id) > + uint32_t sched_id, > + xc_schedparam_t * sched_params) Coding style (omit the space after "*"). > { > int err; > DECLARE_SYSCTL; > @@ -46,6 +47,7 @@ int xc_cpupool_create(xc_interface *xch, > sysctl.u.cpupool_op.cpupool_id = (*ppoolid == XC_CPUPOOL_POOLID_ANY) ? > XEN_SYSCTL_CPUPOOL_PAR_ANY : *ppoolid; > sysctl.u.cpupool_op.sched_id = sched_id; > + sysctl.u.cpupool_op.sched_param = *sched_params; > if ( (err = do_sysctl_save(xch, &sysctl)) != 0 ) > return err; > > diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c > index aa9f8e4..a83a23f 100644 > --- a/tools/python/xen/lowlevel/xc/xc.c > +++ b/tools/python/xen/lowlevel/xc/xc.c > @@ -1704,6 +1704,7 @@ static PyObject *pyxc_cpupool_create(XcObject *self, > PyObject *kwds) > { > uint32_t cpupool = XC_CPUPOOL_POOLID_ANY, sched = XEN_SCHEDULER_CREDIT; > + xc_schedparam_t param; > > static char *kwd_list[] = { "pool", "sched", NULL }; This needs to be extended for the sched_params, or you need to set sane default values in param in case you don't want to support them in the python bindings. Another possibility would be to drop the cpupool python bindings completely (which I would prefer, TBH). Juergen
On Thu, 2017-09-14 at 08:42 +0200, Juergen Gross wrote: > > --- a/tools/libxc/include/xenctrl.h > > +++ b/tools/libxc/include/xenctrl.h > > @@ -1077,17 +1077,21 @@ typedef struct xc_cpupoolinfo { > > > > #define XC_CPUPOOL_POOLID_ANY 0xFFFFFFFF > > > > +typedef xen_sysctl_sched_param_t xc_schedparam_t; > > + > > /** > > * Create a new cpupool. > > * > > * @parm xc_handle a handle to an open hypervisor interface > > * @parm ppoolid pointer to the new cpupool id (in/out) > > * @parm sched_id id of scheduler to use for pool > > + * @parm sched_param parameter of the scheduler of the cpupool eg. > > runq for credit2 > > I would drop "eg. runq for credit2" > +1 > > --- a/tools/python/xen/lowlevel/xc/xc.c > > +++ b/tools/python/xen/lowlevel/xc/xc.c > > @@ -1704,6 +1704,7 @@ static PyObject *pyxc_cpupool_create(XcObject > > *self, > > PyObject *kwds) > > { > > uint32_t cpupool = XC_CPUPOOL_POOLID_ANY, sched = > > XEN_SCHEDULER_CREDIT; > > + xc_schedparam_t param; > > > > static char *kwd_list[] = { "pool", "sched", NULL }; > > [..] > Another possibility would be to drop the cpupool python bindings > completely (which I would prefer, TBH). > +1 Regards, Dario
[Trimming the Cc-list a bit] On Tue, 2017-09-12 at 01:45 +0100, anshulmakkar wrote: > libxc receives scheduler specific configuration parametes from > libxl. > > Signed-off-by: Anshul Makkar <anshulmakkar@gmail.com> > Apart from what Juergen said (including the thing that the series won't compile with this patch at the front), this patch looks fine to me. Regards, Dario
diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 43151cb..e2157e9 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -1077,17 +1077,21 @@ typedef struct xc_cpupoolinfo { #define XC_CPUPOOL_POOLID_ANY 0xFFFFFFFF +typedef xen_sysctl_sched_param_t xc_schedparam_t; + /** * Create a new cpupool. * * @parm xc_handle a handle to an open hypervisor interface * @parm ppoolid pointer to the new cpupool id (in/out) * @parm sched_id id of scheduler to use for pool + * @parm sched_param parameter of the scheduler of the cpupool eg. runq for credit2 * return 0 on success, -1 on failure */ int xc_cpupool_create(xc_interface *xch, uint32_t *ppoolid, - uint32_t sched_id); + uint32_t sched_id, + xc_schedparam_t * sched_param); /** * Destroy a cpupool. Pool must be unused and have no cpu assigned. diff --git a/tools/libxc/xc_cpupool.c b/tools/libxc/xc_cpupool.c index fbd8cc9..fb2d183 100644 --- a/tools/libxc/xc_cpupool.c +++ b/tools/libxc/xc_cpupool.c @@ -36,7 +36,8 @@ static int do_sysctl_save(xc_interface *xch, struct xen_sysctl *sysctl) int xc_cpupool_create(xc_interface *xch, uint32_t *ppoolid, - uint32_t sched_id) + uint32_t sched_id, + xc_schedparam_t * sched_params) { int err; DECLARE_SYSCTL; @@ -46,6 +47,7 @@ int xc_cpupool_create(xc_interface *xch, sysctl.u.cpupool_op.cpupool_id = (*ppoolid == XC_CPUPOOL_POOLID_ANY) ? XEN_SYSCTL_CPUPOOL_PAR_ANY : *ppoolid; sysctl.u.cpupool_op.sched_id = sched_id; + sysctl.u.cpupool_op.sched_param = *sched_params; if ( (err = do_sysctl_save(xch, &sysctl)) != 0 ) return err; diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c index aa9f8e4..a83a23f 100644 --- a/tools/python/xen/lowlevel/xc/xc.c +++ b/tools/python/xen/lowlevel/xc/xc.c @@ -1704,6 +1704,7 @@ static PyObject *pyxc_cpupool_create(XcObject *self, PyObject *kwds) { uint32_t cpupool = XC_CPUPOOL_POOLID_ANY, sched = XEN_SCHEDULER_CREDIT; + xc_schedparam_t param; static char *kwd_list[] = { "pool", "sched", NULL }; @@ -1711,7 +1712,7 @@ static PyObject *pyxc_cpupool_create(XcObject *self, &sched)) return NULL; - if ( xc_cpupool_create(self->xc_handle, &cpupool, sched) < 0 ) + if ( xc_cpupool_create(self->xc_handle, &cpupool, sched, ¶m) < 0 ) return pyxc_error_to_exception(self->xc_handle); return PyLongOrInt_FromLong(cpupool);
libxc receives scheduler specific configuration parametes from libxl. Signed-off-by: Anshul Makkar <anshulmakkar@gmail.com> --- tools/libxc/include/xenctrl.h | 6 +++++- tools/libxc/xc_cpupool.c | 4 +++- tools/python/xen/lowlevel/xc/xc.c | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-)