Skip to contentSkip to conversation

Fix xm sched-sedf command to show a error message

PATCH RESEND In review Masaki Kanno 2 participants 2 messages Feb 26, 2007 – Mar 23, 2007

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 Fix xm sched-sedf command to show a error message

Hi,

I resend the patch to solve the issue that I reported as follows.

http://lists.xensource.com/archives/html/xen-devel/2007-02/msg00760.html

The behavior of the xm sched-sedf command isn't the specification, is it? If it is specification, I withdraw the patch. Could you possibly comment or apply the patch?

Best regards,
Kan

xen/common/sched_credit.c +1 -1
diff -r 2c3a13993b0d xen/common/sched_credit.c
@@ -695,7 +695,7 @@ csched_vcpu_wake(struct vcpu *vc)
     __runq_tickle(cpu, svc);
 }
 
-static int
+static long
 csched_dom_cntl(
     struct domain *d,
     struct xen_domctl_scheduler_op *op)
xen/common/sched_sedf.c +1 -1
diff -r 2c3a13993b0d xen/common/sched_sedf.c
@@ -1353,7 +1353,7 @@ static int sedf_adjust_weights(struct xe
 
 
 /* set or fetch domain scheduling parameters */
-static int sedf_adjust(struct domain *p, struct xen_domctl_scheduler_op *op)
+static long sedf_adjust(struct domain *p, struct xen_domctl_scheduler_op *op)
 {
     struct vcpu *v;
 
xen/common/schedule.c +4 -3
diff -r 2c3a13993b0d xen/common/schedule.c
@@ -497,6 +497,7 @@ long sched_adjust(struct domain *d, stru
 long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
 {
     struct vcpu *v;
+    long ret;
     
     if ( (op->sched_id != ops.sched_id) ||
          ((op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) &&
@@ -525,8 +526,8 @@ long sched_adjust(struct domain *d, stru
     if ( d == current->domain )
         vcpu_schedule_lock_irq(current);
 
-    SCHED_OP(adjust, d, op);
-    TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
+    if ( (ret = SCHED_OP(adjust, d, op)) == 0 )
+        TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
 
     if ( d == current->domain )
         vcpu_schedule_unlock_irq(current);
@@ -537,7 +538,7 @@ long sched_adjust(struct domain *d, stru
             vcpu_unpause(v);
     }
 
-    return 0;
+    return ret;
 }
 
 /* 
xen/include/xen/sched-if.h +1 -1
diff -r 2c3a13993b0d xen/include/xen/sched-if.h
@@ -75,7 +75,7 @@ struct scheduler {
     struct task_slice (*do_schedule) (s_time_t);
 
     int          (*pick_cpu)       (struct vcpu *);
-    int          (*adjust)         (struct domain *,
+    long         (*adjust)         (struct domain *,
                                     struct xen_domctl_scheduler_op *);
     void         (*dump_settings)  (void);
     void         (*dump_cpu_state) (int);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

On Mon, Feb 26, 2007 at 07:08:29PM +0900, Masaki Kanno wrote:

Content-Description: Mail message body

Quoted 4 lines

Hi,

I resend the patch to solve the issue that I reported as follows.

Quoted 8 lines

http://lists.xensource.com/archives/html/xen-devel/2007-02/msg00760.html

The behavior of the xm sched-sedf command isn't the specification, is it? If it is specification, I withdraw the patch. Could you possibly comment or apply the patch?

Thanks Kan. I've taken the patch to schedule.c -- Keir says that the rest is unnecessary.

Cheers,

Ewan.

Quoted 77 lines

Best regards,
Kan

diff -r 2c3a13993b0d xen/common/sched_credit.c

xen/common/sched_credit.c +1 -1
@@ -695,7 +695,7 @@ csched_vcpu_wake(struct vcpu *vc)
     __runq_tickle(cpu, svc);
 }
 
-static int
+static long
 csched_dom_cntl(
     struct domain *d,
     struct xen_domctl_scheduler_op *op)

diff -r 2c3a13993b0d xen/common/sched_sedf.c

xen/common/sched_sedf.c +1 -1
@@ -1353,7 +1353,7 @@ static int sedf_adjust_weights(struct xe
 
 
 /* set or fetch domain scheduling parameters */
-static int sedf_adjust(struct domain *p, struct xen_domctl_scheduler_op *op)
+static long sedf_adjust(struct domain *p, struct xen_domctl_scheduler_op *op)
 {
     struct vcpu *v;
 

diff -r 2c3a13993b0d xen/common/schedule.c

xen/common/schedule.c +4 -3
@@ -497,6 +497,7 @@ long sched_adjust(struct domain *d, stru
 long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op)
 {
     struct vcpu *v;
+    long ret;
 
     if ( (op->sched_id != ops.sched_id) ||
          ((op->cmd != XEN_DOMCTL_SCHEDOP_putinfo) &&
@@ -525,8 +526,8 @@ long sched_adjust(struct domain *d, stru
     if ( d == current->domain )
         vcpu_schedule_lock_irq(current);
 
-    SCHED_OP(adjust, d, op);
-    TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
+    if ( (ret = SCHED_OP(adjust, d, op)) == 0 )
+        TRACE_1D(TRC_SCHED_ADJDOM, d->domain_id);
 
     if ( d == current->domain )
         vcpu_schedule_unlock_irq(current);
@@ -537,7 +538,7 @@ long sched_adjust(struct domain *d, stru
             vcpu_unpause(v);
     }
 
-    return 0;
+    return ret;
 }
 
 /* 

diff -r 2c3a13993b0d xen/include/xen/sched-if.h

xen/include/xen/sched-if.h +1 -1
@@ -75,7 +75,7 @@ struct scheduler {
     struct task_slice (*do_schedule) (s_time_t);
 
     int          (*pick_cpu)       (struct vcpu *);
-    int          (*adjust)         (struct domain *,
+    long         (*adjust)         (struct domain *,
                                     struct xen_domctl_scheduler_op *);
     void         (*dump_settings)  (void);
     void         (*dump_cpu_state) (int);

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel