xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dfaggioli@suse.com>
To: xen-devel@lists.xenproject.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v3 3/4] tools: xenpm: continue to support {set, get}-vcpu-migration-delay
Date: Thu, 15 Mar 2018 18:51:38 +0100	[thread overview]
Message-ID: <152113629824.4918.279469183779339765.stgit@Palanthas.fritz.box> (raw)
In-Reply-To: <152113608271.4918.9160597572418705851.stgit@Palanthas.fritz.box>

Now that it is possible to get and set the migration
delay via the SCHEDOP sysctl, use that in xenpm, instead
of the special purpose libxc interface (which will be
removed in a following commit).

The sysctl, however, requires a cpupool-id argument,
for knowing on which scheduler it is operating on. In
this case, since we don't want to alter xenpm's command
line interface, we always use '0', which means xenpm
will always act on the default cpupool ('Pool-0').

>From this commit on, `xenpm {set,get}-vcpu-migration-delay'
commands work again. But that is only for the sake of
backward compatibility, and their use is deprecated, in
favour of 'xl sched-credit -s [-c <poolid>] -m <delay>'.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.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 v2:
* send the warning to stderr, rather than to stdout.
---
 tools/misc/xenpm.c |   22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/tools/misc/xenpm.c b/tools/misc/xenpm.c
index 762311e5a5..0e1968a23d 100644
--- a/tools/misc/xenpm.c
+++ b/tools/misc/xenpm.c
@@ -1071,14 +1071,24 @@ void set_sched_smt_func(int argc, char *argv[])
 
 void set_vcpu_migration_delay_func(int argc, char *argv[])
 {
+    struct xen_sysctl_credit_schedule sparam;
     int value;
 
+    fprintf(stderr, "WARNING: using xenpm for this purpose is deprecated."
+           " Check out `xl sched-credit -s -m DELAY'\n");
+
     if ( argc != 1 || (value = atoi(argv[0])) < 0 ) {
         fprintf(stderr, "Missing or invalid argument(s)\n");
         exit(EINVAL);
     }
 
-    if ( !xc_set_vcpu_migration_delay(xc_handle, value) )
+    if ( xc_sched_credit_params_get(xc_handle, 0, &sparam) < 0 ) {
+        fprintf(stderr, "getting Credit scheduler parameters failed\n");
+        exit(EINVAL);
+    }
+    sparam.vcpu_migr_delay_us = value;
+
+    if ( !xc_sched_credit_params_set(xc_handle, 0, &sparam) )
         printf("set vcpu migration delay to %d us succeeded\n", value);
     else
         fprintf(stderr, "set vcpu migration delay failed (%d - %s)\n",
@@ -1087,13 +1097,17 @@ void set_vcpu_migration_delay_func(int argc, char *argv[])
 
 void get_vcpu_migration_delay_func(int argc, char *argv[])
 {
-    uint32_t value;
+    struct xen_sysctl_credit_schedule sparam;
+
+    fprintf(stderr, "WARNING: using xenpm for this purpose is deprecated."
+           " Check out `xl sched-credit -s'\n");
 
     if ( argc )
         fprintf(stderr, "Ignoring argument(s)\n");
 
-    if ( !xc_get_vcpu_migration_delay(xc_handle, &value) )
-        printf("Scheduler vcpu migration delay is %d us\n", value);
+    if ( !xc_sched_credit_params_get(xc_handle, 0, &sparam) )
+        printf("Scheduler vcpu migration delay is %d us\n",
+               sparam.vcpu_migr_delay_us);
     else
         fprintf(stderr,
                 "Failed to get scheduler vcpu migration delay (%d - %s)\n",


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-03-15 17:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 17:51 [PATCH v3 0/4] xen/tools: sched: Credit1: improve handling of vCPU migration delay Dario Faggioli
2018-03-15 17:51 ` [PATCH v3 1/4] xen: sched/credit1: make vcpu_migration_delay per-cpupool Dario Faggioli
2018-03-21 16:24   ` George Dunlap
2018-03-15 17:51 ` [PATCH v3 2/4] tools: libxl/xl: allow to get/set Credit1's vcpu_migration_delay Dario Faggioli
2018-03-21 16:08   ` George Dunlap
2018-03-15 17:51 ` Dario Faggioli [this message]
2018-03-15 17:51 ` [PATCH v3 4/4] xen/libxc: suppress direct access to Credit1's migration delay Dario Faggioli
2018-03-16 10:52   ` Jan Beulich
2018-03-21 16:18   ` George Dunlap
2018-03-21 15:28 ` [PATCH v3 0/4] xen/tools: sched: Credit1: improve handling of vCPU " Wei Liu

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=152113629824.4918.279469183779339765.stgit@Palanthas.fritz.box \
    --to=dfaggioli@suse.com \
    --cc=andrew.cooper3@citrix.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).