From: George Dunlap <george.dunlap@citrix.com>
To: Dario Faggioli <dfaggioli@suse.com>, xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH v2 3/5] tools: libxl/xl: allow to get/set Credit1's vcpu_migration_delay
Date: Wed, 28 Feb 2018 14:31:58 +0000 [thread overview]
Message-ID: <e1c33393-f507-f01b-27a7-dda9ee85e5d0@citrix.com> (raw)
In-Reply-To: <151940410808.10991.628776595513490446.stgit@Palanthas.fritz.box>
On 02/23/2018 04:41 PM, Dario Faggioli wrote:
> Make it possible to get and set a (Credit1) scheduler's
> vCPU migration delay via the SCHEDOP sysctl, from both
> libxl and xl (no change needed in libxc).
>
> Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: George Dunlap <george.dunlap@eu.citrix.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> Changes from v1:
> * add missing 'break', fix using wrong variable in xl_sched.c.
>
> Changes are small, but still I'm dropping Wei's Ack.
> ---
> docs/man/xl.pod.1.in | 11 +++++++++++
> tools/libxl/libxl.h | 7 +++++++
> tools/libxl/libxl_sched.c | 10 ++++++++++
> tools/libxl/libxl_types.idl | 1 +
> tools/xl/xl_cmdtable.c | 1 +
> tools/xl/xl_sched.c | 23 ++++++++++++++++-------
> 6 files changed, 46 insertions(+), 7 deletions(-)
>
> diff --git a/docs/man/xl.pod.1.in b/docs/man/xl.pod.1.in
> index 7fd35c9ae7..48da2052cc 100644
> --- a/docs/man/xl.pod.1.in
> +++ b/docs/man/xl.pod.1.in
> @@ -1046,6 +1046,17 @@ we will allow a higher-priority 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.
>
> +=item B<-m DELAY>, B<--migration_delay_us=DELAY>
> +
> +Migration delay specifies for how long a vCPU, after it stopped running should
> +be considered "cache-hot". Basically, if less than DELAY us passed since when
> +the vCPU was executing on a CPU, it is likely that most of the vCPU's working
> +set is still in the CPU's cache, and therefore the vCPU is not migrated.
> +
> +Default is 0. Maximum is 100 ms. This can be effective at preventing vCPUs
> +to bounce among CPUs too quickly, but, at the same time, the scheduler stops
> +being fully work-conserving.
> +
> =back
>
> B<COMBINATION>
> diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
> index eca0ea2c50..edd244278a 100644
> --- a/tools/libxl/libxl.h
> +++ b/tools/libxl/libxl.h
> @@ -299,6 +299,13 @@
> */
> #define LIBXL_HAVE_SCHED_CREDIT2_PARAMS 1
>
> +/*
> + * LIBXL_HAVE_SCHED_CREDIT_MIGR_DELAY indicates that there is a field
> + * in libxl_sched_credit_params called vcpu_migr_delay_us which controls
> + * the resistance of the vCPUs of the cpupool to migrations among pCPUs.
> + */
> +#define LIBXL_HAVE_SCHED_CREDIT_MIGR_DELAY
> +
> /*
> * LIBXL_HAVE_VIRIDIAN_CRASH_CTL indicates that the 'crash_ctl' value
> * is present in the viridian enlightenment enumeration.
> diff --git a/tools/libxl/libxl_sched.c b/tools/libxl/libxl_sched.c
> index 512788f736..07289079ce 100644
> --- a/tools/libxl/libxl_sched.c
> +++ b/tools/libxl/libxl_sched.c
> @@ -291,6 +291,7 @@ int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
>
> scinfo->tslice_ms = sparam.tslice_ms;
> scinfo->ratelimit_us = sparam.ratelimit_us;
> + scinfo->vcpu_migr_delay_us = sparam.vcpu_migr_delay_us;
>
> rc = 0;
> out:
> @@ -321,9 +322,17 @@ int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
> rc = ERROR_INVAL;
> goto out;
> }
> + if (scinfo->vcpu_migr_delay_us
> + && scinfo->vcpu_migr_delay_us > XEN_SYSCTL_CSCHED_MGR_DLY_MAX) {
Same idea -- no need to check if it's zero and then check to see if it's
greater than DLY_MAX.
Other than that, looks good.
-George
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-02-28 14:32 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-23 16:41 [PATCH v2 0/5] xen/tools: sched: Credit1: improve handling of vCPU migration delay Dario Faggioli
2018-02-23 16:41 ` [PATCH v2 1/5] xen: sched/credit: convert scheduling parameter to s_time_t when set Dario Faggioli
2018-02-27 17:55 ` George Dunlap
2018-02-23 16:41 ` [PATCH v2 2/5] xen: sched/credit1: make vcpu_migration_delay per-cpupool Dario Faggioli
2018-02-28 14:20 ` George Dunlap
2018-02-28 14:23 ` George Dunlap
2018-02-28 14:26 ` George Dunlap
2018-02-23 16:41 ` [PATCH v2 3/5] tools: libxl/xl: allow to get/set Credit1's vcpu_migration_delay Dario Faggioli
2018-02-23 18:52 ` Wei Liu
2018-02-28 14:31 ` George Dunlap [this message]
2018-02-23 16:41 ` [PATCH v2 4/5] tools: xenpm: continue to support {set, get}-vcpu-migration-delay Dario Faggioli
2018-02-28 15:02 ` George Dunlap
2018-02-28 15:17 ` Dario Faggioli
2018-02-28 15:59 ` George Dunlap
2018-02-28 17:28 ` Dario Faggioli
2018-02-23 16:42 ` [PATCH v2 5/5] xen/libxc: suppress direct access to Credit1's migration delay Dario Faggioli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1c33393-f507-f01b-27a7-dda9ee85e5d0@citrix.com \
--to=george.dunlap@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=dfaggioli@suse.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).