xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 2 of 3] Support getting scheduler defaults in libxc
Date: Tue, 22 May 2012 11:16:53 +0200	[thread overview]
Message-ID: <19aaa30d7fdce2f1b56c.1337678213@nehalem1> (raw)
In-Reply-To: <patchbomb.1337678211@nehalem1>

[-- Attachment #1: Type: text/plain, Size: 386 bytes --]

Add scheduler specific interfaces to get scheduling defaults from the
hypervisor.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>


4 files changed, 73 insertions(+)
tools/libxc/xc_csched.c  |   21 +++++++++++++++++++++
tools/libxc/xc_csched2.c |   21 +++++++++++++++++++++
tools/libxc/xc_sedf.c    |   21 +++++++++++++++++++++
tools/libxc/xenctrl.h    |   10 ++++++++++



[-- Attachment #2: xen-staging.hg-3.patch --]
[-- Type: text/x-patch, Size: 4372 bytes --]

# HG changeset patch
# User Juergen Gross <juergen.gross@ts.fujitsu.com>
# Date 1337675490 -7200
# Node ID 19aaa30d7fdce2f1b56cb13399d603d955a61fb8
# Parent  56c50b3f6cc3eb1de8b86024d0e41e65345d9a79
Support getting scheduler defaults in libxc

Add scheduler specific interfaces to get scheduling defaults from the
hypervisor.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>

diff -r 56c50b3f6cc3 -r 19aaa30d7fdc tools/libxc/xc_csched.c
--- a/tools/libxc/xc_csched.c	Tue May 22 10:14:32 2012 +0200
+++ b/tools/libxc/xc_csched.c	Tue May 22 10:31:30 2012 +0200
@@ -105,3 +105,24 @@ xc_sched_credit_params_get(
 
     return rc;
 }
+
+int
+xc_sched_credit_defaults_get(
+    xc_interface *xch,
+    uint32_t cpupool_id,
+    struct xen_domctl_sched_credit *sdom)
+{
+    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_getdefaults;
+
+    rc = do_sysctl(xch, &sysctl);
+    if ( rc == 0 )
+        *sdom = sysctl.u.scheduler_op.u.defaults.credit;
+
+    return rc;
+}
diff -r 56c50b3f6cc3 -r 19aaa30d7fdc tools/libxc/xc_csched2.c
--- a/tools/libxc/xc_csched2.c	Tue May 22 10:14:32 2012 +0200
+++ b/tools/libxc/xc_csched2.c	Tue May 22 10:31:30 2012 +0200
@@ -61,3 +61,24 @@ xc_sched_credit2_domain_get(
 
     return err;
 }
+
+int
+xc_sched_credit2_defaults_get(
+    xc_interface *xch,
+    uint32_t cpupool_id,
+    struct xen_domctl_sched_credit2 *sdom)
+{
+    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_CREDIT2;
+    sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_getdefaults;
+
+    rc = do_sysctl(xch, &sysctl);
+    if ( rc == 0 )
+        *sdom = sysctl.u.scheduler_op.u.defaults.credit2;
+
+    return rc;
+}
diff -r 56c50b3f6cc3 -r 19aaa30d7fdc tools/libxc/xc_sedf.c
--- a/tools/libxc/xc_sedf.c	Tue May 22 10:14:32 2012 +0200
+++ b/tools/libxc/xc_sedf.c	Tue May 22 10:31:30 2012 +0200
@@ -76,3 +76,24 @@ int xc_sedf_domain_get(
     *weight    = p->weight;
     return ret;
 }
+
+int
+xc_sched_sedf_defaults_get(
+    xc_interface *xch,
+    uint32_t cpupool_id,
+    struct xen_domctl_sched_sedf *sdom)
+{
+    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_SEDF;
+    sysctl.u.scheduler_op.cmd = XEN_SYSCTL_SCHEDOP_getdefaults;
+
+    rc = do_sysctl(xch, &sysctl);
+    if ( rc == 0 )
+        *sdom = sysctl.u.scheduler_op.u.defaults.sedf;
+
+    return rc;
+}
diff -r 56c50b3f6cc3 -r 19aaa30d7fdc tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Tue May 22 10:14:32 2012 +0200
+++ b/tools/libxc/xenctrl.h	Tue May 22 10:31:30 2012 +0200
@@ -664,6 +664,9 @@ int xc_sedf_domain_get(xc_interface *xch
                        uint64_t* period, uint64_t *slice,
                        uint64_t *latency, uint16_t *extratime,
                        uint16_t *weight);
+int xc_sched_sedf_defaults_get(xc_interface *xch,
+                               uint32_t cpupool_id,
+                               struct xen_domctl_sched_sedf *sdom);
 
 int xc_sched_credit_domain_set(xc_interface *xch,
                                uint32_t domid,
@@ -678,12 +681,19 @@ int xc_sched_credit_params_get(xc_interf
 int xc_sched_credit_params_get(xc_interface *xch,
                               uint32_t cpupool_id,
                               struct xen_sysctl_credit_schedule *schedule);
+int xc_sched_credit_defaults_get(xc_interface *xch,
+                               uint32_t cpupool_id,
+                               struct xen_domctl_sched_credit *sdom);
+
 int xc_sched_credit2_domain_set(xc_interface *xch,
                                uint32_t domid,
                                struct xen_domctl_sched_credit2 *sdom);
 
 int xc_sched_credit2_domain_get(xc_interface *xch,
                                uint32_t domid,
+                               struct xen_domctl_sched_credit2 *sdom);
+int xc_sched_credit2_defaults_get(xc_interface *xch,
+                               uint32_t cpupool_id,
                                struct xen_domctl_sched_credit2 *sdom);
 
 int

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2012-05-22  9:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-22  9:16 [PATCH 0 of 3] support of setting scheduler parameters on domain creation Juergen Gross
2012-05-22  9:16 ` [PATCH 1 of 3] Support of getting scheduler defaults Juergen Gross
2012-05-22 12:22   ` Ian Campbell
2012-05-22 12:29     ` Juergen Gross
2012-05-22 12:32       ` Ian Campbell
2012-05-22 12:58         ` Juergen Gross
2012-05-22 13:05           ` George Dunlap
2012-05-22 13:16             ` Ian Campbell
2012-05-22 13:40             ` Ian Campbell
2012-05-22 14:59               ` Ian Campbell
2012-05-22 23:46                 ` Dario Faggioli
2012-05-23  5:34                   ` Juergen Gross
2012-05-23  7:22                     ` Dario Faggioli
2012-05-23  7:41                       ` Ian Campbell
2012-05-23  8:45                         ` Juergen Gross
2012-05-23  9:17                           ` Ian Campbell
2012-05-23 10:18                           ` Dario Faggioli
2012-05-23  8:48                       ` Juergen Gross
2012-05-22  9:16 ` Juergen Gross [this message]
2012-05-22  9:16 ` [PATCH 3 of 3] full support of setting scheduler parameters on domain creation Juergen Gross
2012-05-22 12:30   ` Ian Campbell
2012-05-22 12:39     ` Juergen Gross
2012-05-22 12:51       ` Ian Campbell
2012-05-22 22:15       ` 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=19aaa30d7fdce2f1b56c.1337678213@nehalem1 \
    --to=juergen.gross@ts.fujitsu.com \
    --cc=xen-devel@lists.xensource.com \
    /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).