All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] Add a global parameter adjustment to the switchable scheduler interface
@ 2010-05-04 19:32 George Dunlap
  2010-05-04 21:52 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: George Dunlap @ 2010-05-04 19:32 UTC (permalink / raw)
  To: xen-devel, Kathy Hadley, Juergen Gross, Keir Fraser

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

...along with a new DOMCTL to call it directly.  This is in order to
support DornerWorks' new
ARINC653 scheduler.

A couple of notes:
* Modifies DOMCTL interface to overload the domid parameter for a
cpupool parameter
* Adds cpupool_scheduler_from_pool_id() to cpupool interface

Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

[-- Attachment #2: add-adjust_global-scheduler-callback.diff --]
[-- Type: text/x-diff, Size: 5762 bytes --]

Add a global parameter adjustment to the switchable scheduler interface
...along with a new DOMCTL to call it directly.  This is in order to support DornerWorks' new
ARINC653 scheduler.

A couple of notes:
* Modifies DOMCTL interface to overload the domid parameter for a cpupool parameter
* Adds cpupool_scheduler_from_pool_id() to cpupool interface

Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>


diff -r 0aa4bb55fbb5 xen/common/domctl.c
--- a/xen/common/domctl.c	Tue May 04 14:10:32 2010 -0500
+++ b/xen/common/domctl.c	Tue May 04 14:21:11 2010 -0500
@@ -597,22 +597,35 @@
 
     case XEN_DOMCTL_scheduler_op:
     {
-        struct domain *d;
+        if ( (op->u.scheduler_op.cmd == XEN_DOMCTL_SCHEDOP_put_global_info)
+          || (op->u.scheduler_op.cmd == XEN_DOMCTL_SCHEDOP_get_global_info) )
+        {
+            ret = sched_adjust_global(op->poolid, &op->u.scheduler_op);
+            if (op->u.scheduler_op.cmd == XEN_DOMCTL_SCHEDOP_get_global_info)
+            {
+                if ( copy_to_guest(u_domctl, op, 1) )
+                    ret = -EFAULT;
+            }
+        }
+        else
+        {
+            struct domain *d;
 
-        ret = -ESRCH;
-        if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
-            break;
+            ret = -ESRCH;
+            if ( (d = rcu_lock_domain_by_id(op->domain)) == NULL )
+                break;
 
-        ret = xsm_scheduler(d);
-        if ( ret )
-            goto scheduler_op_out;
+            ret = xsm_scheduler(d);
+            if ( ret )
+                goto scheduler_op_out;
 
-        ret = sched_adjust(d, &op->u.scheduler_op);
-        if ( copy_to_guest(u_domctl, op, 1) )
-            ret = -EFAULT;
+            ret = sched_adjust(d, &op->u.scheduler_op);
+            if ( copy_to_guest(u_domctl, op, 1) )
+                ret = -EFAULT;
 
-    scheduler_op_out:
-        rcu_unlock_domain(d);
+        scheduler_op_out:
+            rcu_unlock_domain(d);
+        }
     }
     break;
 
diff -r 0aa4bb55fbb5 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Tue May 04 14:10:32 2010 -0500
+++ b/xen/common/sched_credit.c	Tue May 04 14:21:11 2010 -0500
@@ -1564,6 +1564,7 @@
     .wake           = csched_vcpu_wake,
 
     .adjust         = csched_dom_cntl,
+    .adjust_global  = NULL,
 
     .pick_cpu       = csched_cpu_pick,
     .do_schedule    = csched_schedule,
diff -r 0aa4bb55fbb5 xen/common/sched_sedf.c
--- a/xen/common/sched_sedf.c	Tue May 04 14:10:32 2010 -0500
+++ b/xen/common/sched_sedf.c	Tue May 04 14:21:11 2010 -0500
@@ -1518,6 +1518,7 @@
     .sleep          = sedf_sleep,
     .wake           = sedf_wake,
     .adjust         = sedf_adjust,
+    .adjust_global  = NULL,
 };
 
 /*
diff -r 0aa4bb55fbb5 xen/common/schedule.c
--- a/xen/common/schedule.c	Tue May 04 14:10:32 2010 -0500
+++ b/xen/common/schedule.c	Tue May 04 14:21:11 2010 -0500
@@ -881,6 +881,27 @@
     return ret;
 }
 
+/* Adjust scheduling parameters globally */
+long sched_adjust_global(int poolid, struct xen_domctl_scheduler_op *op)
+{
+    long ret;
+    struct scheduler * sched;
+
+    if ( (op->sched_id != ops.sched_id)
+      || ( (op->cmd != XEN_DOMCTL_SCHEDOP_put_global_info)
+        && (op->cmd != XEN_DOMCTL_SCHEDOP_get_global_info) ) )
+        return -EINVAL;
+
+    sched = cpupool_scheduler_by_pool_id(poolid);
+
+    if ( sched == NULL )
+        return -ESRCH;
+
+    ret = SCHED_OP(sched, adjust_global, op);
+
+    return ret;
+}
+
 static void vcpu_periodic_timer_work(struct vcpu *v)
 {
     s_time_t now = NOW();
diff -r 0aa4bb55fbb5 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Tue May 04 14:10:32 2010 -0500
+++ b/xen/include/public/domctl.h	Tue May 04 14:21:11 2010 -0500
@@ -308,6 +308,8 @@
 /* Set or get info? */
 #define XEN_DOMCTL_SCHEDOP_putinfo 0
 #define XEN_DOMCTL_SCHEDOP_getinfo 1
+#define XEN_DOMCTL_SCHEDOP_put_global_info 2
+#define XEN_DOMCTL_SCHEDOP_get_global_info 3
 struct xen_domctl_scheduler_op {
     uint32_t sched_id;  /* XEN_SCHEDULER_* */
     uint32_t cmd;       /* XEN_DOMCTL_SCHEDOP_* */
@@ -877,7 +879,10 @@
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
 #define XEN_DOMCTL_gdbsx_domstatus             1003
     uint32_t interface_version; /* XEN_DOMCTL_INTERFACE_VERSION */
-    domid_t  domain;
+    union {
+        domid_t  domain;
+        uint16_t poolid;
+    };
     union {
         struct xen_domctl_createdomain      createdomain;
         struct xen_domctl_getdomaininfo     getdomaininfo;
diff -r 0aa4bb55fbb5 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Tue May 04 14:10:32 2010 -0500
+++ b/xen/include/xen/sched-if.h	Tue May 04 14:21:11 2010 -0500
@@ -115,6 +115,8 @@
     int          (*pick_cpu)       (struct scheduler *, struct vcpu *);
     int          (*adjust)         (struct scheduler *, struct domain *,
                                     struct xen_domctl_scheduler_op *);
+    int          (*adjust_global)  (struct scheduler *,
+                                    struct xen_domctl_scheduler_op *);
     void         (*dump_settings)  (struct scheduler *);
     void         (*dump_cpu_state) (struct scheduler *, int);
 
diff -r 0aa4bb55fbb5 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Tue May 04 14:10:32 2010 -0500
+++ b/xen/include/xen/sched.h	Tue May 04 14:21:11 2010 -0500
@@ -468,6 +468,7 @@
 void sched_destroy_domain(struct domain *d);
 int sched_move_domain(struct domain *d, struct cpupool *c);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
+long sched_adjust_global(int poolid, struct xen_domctl_scheduler_op *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [RFC] Add a global parameter adjustment to the switchable scheduler interface
  2010-05-04 19:32 [PATCH] [RFC] Add a global parameter adjustment to the switchable scheduler interface George Dunlap
@ 2010-05-04 21:52 ` Keir Fraser
  2010-05-05 12:57   ` Kathy Hadley
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2010-05-04 21:52 UTC (permalink / raw)
  To: George Dunlap, xen-devel, Kathy Hadley, Juergen Gross

I decided the new commands should be sysctl. As should the cpupool commands,
so I moved those. A modified version of this patch is checked in as
xen-unstable:21282.

 -- Keir

On 04/05/2010 20:32, "George Dunlap" <dunlapg@umich.edu> wrote:

> ...along with a new DOMCTL to call it directly.  This is in order to
> support DornerWorks' new
> ARINC653 scheduler.
> 
> A couple of notes:
> * Modifies DOMCTL interface to overload the domid parameter for a
> cpupool parameter
> * Adds cpupool_scheduler_from_pool_id() to cpupool interface
> 
> Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd
> 
> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] [RFC] Add a global parameter adjustment to the switchable scheduler interface
  2010-05-04 21:52 ` Keir Fraser
@ 2010-05-05 12:57   ` Kathy Hadley
  2010-05-05 15:01     ` George Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Kathy Hadley @ 2010-05-05 12:57 UTC (permalink / raw)
  To: Keir Fraser, George Dunlap, xen-devel, Juergen Gross

Keir & George,
  Thank you for your help with this.  I will work on modifying my other
patch (for the ARINC 653 scheduler) to reflect these changes and other
comments received.

  I just checked the mercurial repository for xen-unstable.  The latest
changeset I see is 21278 (23 hours ago).  I'm not familiar with
mercurial - when will I be able to see the changes that Keir checked in?

  Thank you,
Kathy Hadley
DornerWorks, Ltd.

> -----Original Message-----
> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
> Sent: Tuesday, May 04, 2010 5:52 PM
> To: George Dunlap; xen-devel@lists.xensource.com; Kathy Hadley;
Juergen
> Gross
> Subject: Re: [PATCH] [RFC] Add a global parameter adjustment to the
> switchable scheduler interface
> 
> I decided the new commands should be sysctl. As should the cpupool
> commands,
> so I moved those. A modified version of this patch is checked in as
> xen-unstable:21282.
> 
>  -- Keir
> 
> On 04/05/2010 20:32, "George Dunlap" <dunlapg@umich.edu> wrote:
> 
> > ...along with a new DOMCTL to call it directly.  This is in order to
> > support DornerWorks' new
> > ARINC653 scheduler.
> >
> > A couple of notes:
> > * Modifies DOMCTL interface to overload the domid parameter for a
> > cpupool parameter
> > * Adds cpupool_scheduler_from_pool_id() to cpupool interface
> >
> > Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd
> >
> > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RE: [PATCH] [RFC] Add a global parameter adjustment to the switchable scheduler interface
  2010-05-05 12:57   ` Kathy Hadley
@ 2010-05-05 15:01     ` George Dunlap
  2010-05-05 19:15       ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: George Dunlap @ 2010-05-05 15:01 UTC (permalink / raw)
  To: Kathy Hadley; +Cc: Juergen Gross, xen-devel, Keir Fraser

It's not to do with mercurial; it's to do with our setup.  There's an
internal repository that Keir submits to.  I believe that goes through
some basic testing (like, "does it compile"), before being
automatically pushed to the public repository (which is what you see).
 Usually it doesn't take that long, unless something is broken.  If
you still don't have it by tomorrow, something's definitely wrong.

 -George

On Wed, May 5, 2010 at 7:57 AM, Kathy Hadley
<Kathy.Hadley@dornerworks.com> wrote:
> Keir & George,
>  Thank you for your help with this.  I will work on modifying my other
> patch (for the ARINC 653 scheduler) to reflect these changes and other
> comments received.
>
>  I just checked the mercurial repository for xen-unstable.  The latest
> changeset I see is 21278 (23 hours ago).  I'm not familiar with
> mercurial - when will I be able to see the changes that Keir checked in?
>
>  Thank you,
> Kathy Hadley
> DornerWorks, Ltd.
>
>> -----Original Message-----
>> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>> Sent: Tuesday, May 04, 2010 5:52 PM
>> To: George Dunlap; xen-devel@lists.xensource.com; Kathy Hadley;
> Juergen
>> Gross
>> Subject: Re: [PATCH] [RFC] Add a global parameter adjustment to the
>> switchable scheduler interface
>>
>> I decided the new commands should be sysctl. As should the cpupool
>> commands,
>> so I moved those. A modified version of this patch is checked in as
>> xen-unstable:21282.
>>
>>  -- Keir
>>
>> On 04/05/2010 20:32, "George Dunlap" <dunlapg@umich.edu> wrote:
>>
>> > ...along with a new DOMCTL to call it directly.  This is in order to
>> > support DornerWorks' new
>> > ARINC653 scheduler.
>> >
>> > A couple of notes:
>> > * Modifies DOMCTL interface to overload the domid parameter for a
>> > cpupool parameter
>> > * Adds cpupool_scheduler_from_pool_id() to cpupool interface
>> >
>> > Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd
>> >
>> > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
>>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: RE: [PATCH] [RFC] Add a global parameter adjustment to the switchable scheduler interface
  2010-05-05 15:01     ` George Dunlap
@ 2010-05-05 19:15       ` Keir Fraser
  0 siblings, 0 replies; 5+ messages in thread
From: Keir Fraser @ 2010-05-05 19:15 UTC (permalink / raw)
  To: George Dunlap, Kathy Hadley; +Cc: Juergen Gross, xen-devel

You can pick up the internal tree from
http://xenbits.xensource.com/staging/xen-unstable.hg

 -- Keir

On 05/05/2010 16:01, "George Dunlap" <George.Dunlap@eu.citrix.com> wrote:

> It's not to do with mercurial; it's to do with our setup.  There's an
> internal repository that Keir submits to.  I believe that goes through
> some basic testing (like, "does it compile"), before being
> automatically pushed to the public repository (which is what you see).
>  Usually it doesn't take that long, unless something is broken.  If
> you still don't have it by tomorrow, something's definitely wrong.
> 
>  -George
> 
> On Wed, May 5, 2010 at 7:57 AM, Kathy Hadley
> <Kathy.Hadley@dornerworks.com> wrote:
>> Keir & George,
>>  Thank you for your help with this.  I will work on modifying my other
>> patch (for the ARINC 653 scheduler) to reflect these changes and other
>> comments received.
>> 
>>  I just checked the mercurial repository for xen-unstable.  The latest
>> changeset I see is 21278 (23 hours ago).  I'm not familiar with
>> mercurial - when will I be able to see the changes that Keir checked in?
>> 
>>  Thank you,
>> Kathy Hadley
>> DornerWorks, Ltd.
>> 
>>> -----Original Message-----
>>> From: Keir Fraser [mailto:keir.fraser@eu.citrix.com]
>>> Sent: Tuesday, May 04, 2010 5:52 PM
>>> To: George Dunlap; xen-devel@lists.xensource.com; Kathy Hadley;
>> Juergen
>>> Gross
>>> Subject: Re: [PATCH] [RFC] Add a global parameter adjustment to the
>>> switchable scheduler interface
>>> 
>>> I decided the new commands should be sysctl. As should the cpupool
>>> commands,
>>> so I moved those. A modified version of this patch is checked in as
>>> xen-unstable:21282.
>>> 
>>>  -- Keir
>>> 
>>> On 04/05/2010 20:32, "George Dunlap" <dunlapg@umich.edu> wrote:
>>> 
>>>> ...along with a new DOMCTL to call it directly.  This is in order to
>>>> support DornerWorks' new
>>>> ARINC653 scheduler.
>>>> 
>>>> A couple of notes:
>>>> * Modifies DOMCTL interface to overload the domid parameter for a
>>>> cpupool parameter
>>>> * Adds cpupool_scheduler_from_pool_id() to cpupool interface
>>>> 
>>>> Based on code from Josh Holtrop and Kathy Hadley at DornerWorks, Ltd
>>>> 
>>>> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
>>> 
>> 
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@lists.xensource.com
>> http://lists.xensource.com/xen-devel
>> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-05 19:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-04 19:32 [PATCH] [RFC] Add a global parameter adjustment to the switchable scheduler interface George Dunlap
2010-05-04 21:52 ` Keir Fraser
2010-05-05 12:57   ` Kathy Hadley
2010-05-05 15:01     ` George Dunlap
2010-05-05 19:15       ` Keir Fraser

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.