xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dieter Bloms <dieter@bloms.de>
To: Dario Faggioli <dario.faggioli@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Dieter Bloms <dieter@bloms.de>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [Xen-users] xl doesn't honour the parameter cpu_weight from my config file while xm does honour it
Date: Mon, 23 Apr 2012 21:35:18 +0200	[thread overview]
Message-ID: <20120423193518.GA16134@bloms.de> (raw)
In-Reply-To: <1335197251.22133.5.camel@Solace>

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

Hi,


On Mon, Apr 23, Dario Faggioli wrote:

> > I checked out the source with git not hg, may I produce a diff with git
> > and send it via mail ?
> > 
> I think you should. Either use something automatic like git `send-email'
> or just produce the diff and then inline or attach, following also the
> other instructions Ian pointed you to (on the wiki)... Was it this you
> were asking?

yes.

ok, second try ;)
I hope this fit more your needs.

I've defined a new union in the libxl_domain_build_info structure.
For this I had to move some structure definition like
libxl_sched_credit_domain more to the top.
I named the union 'us' for union scheduler, because the letter 'u' was
already used for the type of domain.


-- 
Best regards

  Dieter Bloms

--
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
From field.

[-- Attachment #2: add_support_for_cpu_weight_config_in_xl.diff --]
[-- Type: text/x-diff, Size: 5166 bytes --]

libxl: set domain scheduling parameters while creating the dom

the domain specific scheduling parameters like cpu_weight, cap, slice, ...
will be set during creating the domain, so this parameters can be defined
in the domain config file

Signed-off-by: Dieter Bloms <dieter@bloms.de>

diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index 0bdd654..38acff4 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -124,8 +124,27 @@ int libxl__build_post(libxl__gc *gc, uint32_t domid,
     char *dom_path, *vm_path;
     xs_transaction_t t;
     char **ents, **hvm_ents;
+    libxl_scheduler sched;
     int i;
 
+    sched = libxl_get_scheduler (ctx);
+    switch (sched) {
+    case LIBXL_SCHEDULER_SEDF:
+      libxl_sched_sedf_domain_set(ctx, domid, &(info->us.sedf));
+      break;
+    case LIBXL_SCHEDULER_CREDIT:
+      libxl_sched_credit_domain_set(ctx, domid, &(info->us.credit));
+      break;
+    case LIBXL_SCHEDULER_CREDIT2:
+      libxl_sched_credit2_domain_set(ctx, domid, &(info->us.credit2));
+      break;
+    case LIBXL_SCHEDULER_ARINC653:
+      /* not implemented */
+      break;
+    default:
+        abort();
+    }
+
     libxl_cpuid_apply_policy(ctx, domid);
     if (info->cpuid != NULL)
         libxl_cpuid_set(ctx, domid, info->cpuid);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 5cf9708..c1cdc3c 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -224,6 +224,27 @@ libxl_domain_create_info = Struct("domain_create_info",[
 
 MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
 
+libxl_sched_credit_domain = Struct("sched_credit_domain", [
+    ("weight", integer),
+    ("cap", integer),
+    ])
+
+libxl_sched_credit2_domain = Struct("sched_credit2_domain", [
+    ("weight", integer),
+    ])
+
+libxl_sched_sedf_domain = Struct("sched_sedf_domain", [
+    ("period", integer),
+    ("slice", integer),
+    ("latency", integer),
+    ("extratime", integer),
+    ("weight", integer),
+    ])
+
+libxl_sched_arinc653_domain = Struct("sched_arinc653_domain", [
+    ("weight", integer),
+    ])
+
 # Instances of libxl_file_reference contained in this struct which
 # have been mapped (with libxl_file_reference_map) will be unmapped
 # by libxl_domain_build/restore. If either of these are never called
@@ -256,6 +277,13 @@ libxl_domain_build_info = Struct("domain_build_info",[
     # extra parameters pass directly to qemu for HVM guest, NULL terminated
     ("extra_hvm",        libxl_string_list),
 
+    ("us", KeyedUnion(None, libxl_scheduler, "sched",
+                 [("credit", libxl_sched_credit_domain),
+                 ("credit2", libxl_sched_credit2_domain),
+                 ("sedf", libxl_sched_sedf_domain),
+                 ("arinc653", libxl_sched_arinc653_domain),
+                 ], keyvar_init_val = "-1")),
+
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware",         string),
                                        ("bios",             libxl_bios_type),
@@ -417,28 +445,12 @@ libxl_cputopology = Struct("cputopology", [
     ("node", uint32),
     ], dir=DIR_OUT)
 
-libxl_sched_credit_domain = Struct("sched_credit_domain", [
-    ("weight", integer),
-    ("cap", integer),
-    ])
 
 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),
-    ])
-
-libxl_sched_sedf_domain = Struct("sched_sedf_domain", [
-    ("period", integer),
-    ("slice", integer),
-    ("latency", integer),
-    ("extratime", integer),
-    ("weight", integer),
-    ])
-
 libxl_event_type = Enumeration("event_type", [
     (1, "DOMAIN_SHUTDOWN"),
     (2, "DOMAIN_DEATH"),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5703512..db51ca6 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -587,6 +587,23 @@ static void parse_config_data(const char *configfile_filename_report,
     libxl_domain_build_info_init_type(b_info, c_info->type);
 
     /* the following is the actual config parsing with overriding values in the structures */
+    if (!xlu_cfg_get_long (config, "cpu_weight", &l, 0))
+        b_info->us.credit.weight = l;
+        b_info->us.credit2.weight = l;
+        b_info->us.sedf.weight = l;
+
+    if (!xlu_cfg_get_long (config, "cap", &l, 0))
+        b_info->us.credit.cap = l;
+
+    if (!xlu_cfg_get_long (config, "period", &l, 0))
+        b_info->us.sedf.period = l;
+    if (!xlu_cfg_get_long (config, "slice", &l, 0))
+        b_info->us.sedf.period = l;
+    if (!xlu_cfg_get_long (config, "latency", &l, 0))
+        b_info->us.sedf.period = l;
+    if (!xlu_cfg_get_long (config, "extratime", &l, 0))
+        b_info->us.sedf.period = l;
+
     if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
         b_info->max_vcpus = l;
         b_info->cur_vcpus = (1 << l) - 1;

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

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

  reply	other threads:[~2012-04-23 19:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120420150012.GB3720@bloms.de>
2012-04-20 15:13 ` [Xen-users] xl doesn't honour the parameter cpu_weight from my config file while xm does honour it Ian Campbell
2012-04-20 15:23   ` Dieter Bloms
2012-04-23  9:46   ` Dieter Bloms
2012-04-23 12:04     ` Ian Campbell
2012-04-23 14:22       ` Dario Faggioli
2012-04-23 15:41         ` Dieter Bloms
2012-04-23 16:07           ` Dario Faggioli
2012-04-23 19:35             ` Dieter Bloms [this message]
2012-04-24  6:05               ` Dario Faggioli
2012-04-24 12:14                 ` Dieter Bloms
2012-04-24 13:09                   ` Ian Campbell
2012-04-24 14:33                     ` Dieter Bloms
2012-04-24 14:51                       ` Ian Campbell
2012-04-24 16:03                         ` Ian Jackson
2012-04-24 16:15                           ` Ian Campbell
2012-04-24 16:20                             ` Ian Jackson
2012-04-24 16:27                               ` Ian Campbell
2012-04-24 18:26                               ` Dieter Bloms
2012-04-24 19:35                                 ` Dieter Bloms
2012-04-25  9:07                                   ` Ian Campbell
2012-04-25 10:40                                     ` Ian Jackson
2012-04-24 13:24                   ` Ian Jackson
2012-04-24 13:27                     ` Ian Campbell
2012-04-24 13:33                       ` Ian Jackson

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=20120423193518.GA16134@bloms.de \
    --to=dieter@bloms.de \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=xen-devel@lists.xen.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).