All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: "Mike D. Day" <ncmike@us.ibm.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH] Scheduling groups, credit scheduler support
Date: Tue, 18 Dec 2007 11:50:28 +0000	[thread overview]
Message-ID: <20071218115028.GD4244@implementation.uk.xensource.com> (raw)
In-Reply-To: <20071129201959.GC12559@silverwood.ncultra.org>

Hi,

Here is a bunch of other fixes I had to use

Samuel

diff -r b968ee4f6b4f -r d8ed81d5dc55 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c	Mon Dec 17 12:05:18 2007 +0000
+++ b/tools/libxc/xc_domain.c	Tue Dec 18 11:45:05 2007 +0000
@@ -938,6 +938,7 @@ int xc_group_get_status(int handle, stru
     domctl.u.scheduler_op.cmd = XEN_DOMCTL_SCHEDOP_group;
     domctl.u.scheduler_op.u.group.op = SGRP_get_status;
     domctl.u.scheduler_op.u.group.id_master = group->id_master;
+    domctl.u.scheduler_op.u.group.id_member = group->id_master;
     ret = do_domctl(handle, &domctl);
 
     if ( ret == 0 )

in xen's code, id_member is used for both get_status and get_master. The
code should probably be reworked there so that the fix above is not
needed.

diff -r b968ee4f6b4f -r d8ed81d5dc55 xen/common/domctl.c
--- a/xen/common/domctl.c	Mon Dec 17 12:05:18 2007 +0000
+++ b/xen/common/domctl.c	Tue Dec 18 11:45:05 2007 +0000
@@ -491,6 +491,8 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
         if ( op->u.scheduler_op.cmd == XEN_DOMCTL_SCHEDOP_group ) {
             rcu_unlock_domain(d);
             ret = sched_group_op(&op->u.scheduler_op.u.group);
+            if ( copy_to_guest(u_domctl, op, 1) )
+                ret = -EFAULT;
             break;
         }
         
Else the userland doesn't get any value :)

diff -r b968ee4f6b4f -r d8ed81d5dc55 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Mon Dec 17 12:05:18 2007 +0000
+++ b/xen/common/sched_credit.c	Tue Dec 18 11:45:05 2007 +0000
@@ -393,10 +393,12 @@ static inline void delegate_active_vcpus
         if ( !list_empty(&member->active_sdom_elem) )
         {
             list_del_init(&member->active_sdom_elem);
+            BUG_ON( csched_priv.weight < member->weight );
             csched_priv.weight -= member->weight;
         }
 
-        if ( list_empty(&master->active_sdom_elem) )
+        if ( !list_empty(&master->active_vcpu) &&
+             list_empty(&master->active_sdom_elem) )
         {
             list_add(&master->active_sdom_elem, &csched_priv.active_sdom);
             csched_priv.weight += master->weight;
@@ -429,6 +431,7 @@ static inline void reclaim_active_vcpus(
             !list_empty(&master->active_sdom_elem) )
         {
             list_del_init(&master->active_sdom_elem);
+            BUG_ON( csched_priv.weight < master->weight );
             csched_priv.weight -= master->weight;
         }
         if ( !list_empty(&member->active_vcpu) &&
@@ -913,7 +916,6 @@ static int csched_group_op(struct xen_do
         member = get_domain_by_id(op->id_member);
         if ( !member )
             goto release_master;
-        ret = 0;
         if ( op->op == SGRP_add_member )
             op->reason =
                 add_sanity_check(csched_dom(member), csched_dom(master));
@@ -922,6 +924,7 @@ static int csched_group_op(struct xen_do
                 rem_sanity_check(csched_dom(member), csched_dom(master));
         if ( op->reason )
             goto release_member;
+        ret = 0;
 
         spin_lock_irqsave(&csched_priv.lock, flags);
         if ( op->op == SGRP_add_member )
@@ -1193,6 +1196,7 @@ csched_acct(void)
         list_for_each_safe( iter_vcpu, next_vcpu, &sdom->active_vcpu )
         {
             svc = list_entry(iter_vcpu, struct csched_vcpu, active_vcpu_elem);
+            BUG_ON( sdom != master_dom(svc->sdom) );
 
             /* Increment credit */
             atomic_add(credit_fair, &svc->credit);

More safety.

diff -r b968ee4f6b4f -r d8ed81d5dc55 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Mon Dec 17 12:05:18 2007 +0000
+++ b/xen/include/public/domctl.h	Tue Dec 18 11:45:05 2007 +0000
@@ -333,7 +333,7 @@ struct xen_domctl_scheduler_op {
             uint8_t is_member;
             domid_t id_master;
             domid_t id_member;
-        } group __attribute__ (( aligned ));
+        } group;
     } u;
 };
 typedef struct xen_domctl_scheduler_op xen_domctl_scheduler_op_t;

Aligned is of no use.

      parent reply	other threads:[~2007-12-18 11:50 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 20:19 [PATCH] Scheduling groups, credit scheduler support Mike D. Day
2007-11-29 22:36 ` Chris B
2007-12-03 15:37   ` Chris
2007-12-03 17:59     ` Mike D. Day
2007-12-04 19:32       ` Chris
2007-12-04 23:04         ` Keir Fraser
2007-12-06 16:42           ` Chris
2007-12-14 17:20         ` Samuel Thibault
2007-12-18 16:04           ` Chris
2007-12-04 10:38 ` [PATCH] " Keir Fraser
2007-12-04 13:50   ` Mike D. Day
2007-12-04 23:06     ` Keir Fraser
2007-12-14 13:35       ` Mike D. Day
2007-12-14 13:50         ` Keir Fraser
2007-12-14 16:26         ` Samuel Thibault
2007-12-14 17:36           ` Samuel Thibault
2007-12-19 16:08             ` Samuel Thibault
2007-12-14 16:49     ` Samuel Thibault
2007-12-19 20:18       ` Mike D. Day
2007-12-05  1:34 ` does xen-linux for PV support the Linux Standards base , or not ? tgh
2007-12-05  3:49   ` Mark Williamson
2007-12-14 17:01 ` [PATCH] Scheduling groups, credit scheduler support Samuel Thibault
2007-12-17 16:57   ` Samuel Thibault
2007-12-18 11:50 ` Samuel Thibault [this message]

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=20071218115028.GD4244@implementation.uk.xensource.com \
    --to=samuel.thibault@eu.citrix.com \
    --cc=ncmike@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.