Skip to contentSkip to conversation

xen: sched: use default scheduler upon an invalid "sched="

PATCH In review Dario Faggioli 6 participants 6 messages Jun 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: sched: use default scheduler upon an invalid "sched="

instead of just the first scheduler we find in the array.

In fact, right now, if someone makes a typo when passing the "sched=" command line option to Xen, we (with all schedulers configured in) pick ARINC653, which is most likely not what one would expect.

Go for the default scheduler instead.

---
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Doug Goldstein <[email protected]>
Cc: Jonathan Creekmore <[email protected]>
---
I don't think I'm going to ask for this to be put in 4.7, as I don't want to give Wei an heart attack... :-)

Considering it for backporting should be enough, IMO.

---
 xen/common/schedule.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/common/schedule.c +2 -1
index 5e35310..7ac12d3 100644
@@ -1625,7 +1625,8 @@ void __init scheduler_init(void)
     {
         printk("Could not find scheduler: %s\n", opt_sched);
         for ( i = 0; i < NUM_SCHEDULERS; i++ )
-            if ( schedulers[i] )
+            if ( schedulers[i] &&
+                 !strcmp(schedulers[i]->opt_name, CONFIG_SCHED_DEFAULT) )
             {
                 ops = *schedulers[i];
                 break;

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

Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dario Faggioli

instead of just the first scheduler we find in the array.

In fact, right now, if someone makes a typo when passing the "sched=" command line option to Xen, we (with all schedulers configured in) pick ARINC653, which is most likely not what one would expect.

Quoted 8 lines

Go for the default scheduler instead.

---
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Doug Goldstein <[email protected]>
Cc: Jonathan Creekmore <[email protected]>

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

Reviewed-by on v1 1/1
#2 lore raw
In reply to Dario Faggioli
Quoted 10 lines · Dario Faggioli

instead of just the first scheduler we find in the array.

In fact, right now, if someone makes a typo when passing the "sched=" command line option to Xen, we (with all schedulers configured in) pick ARINC653, which is most likely not what one would expect.

Quoted 8 lines

Go for the default scheduler instead.

---
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Doug Goldstein <[email protected]>
Cc: Jonathan Creekmore <[email protected]>

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

Reviewed-by on v1 1/1
#3 lore raw
In reply to Dario Faggioli
Quoted 7 lines · Dario Faggioli

instead of just the first scheduler we find in the array.

In fact, right now, if someone makes a typo when passing the "sched=" command line option to Xen, we (with all schedulers configured in) pick ARINC653, which is most likely not what one would expect.

Quoted 8 lines

Go for the default scheduler instead.

---
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Doug Goldstein <[email protected]>
Cc: Jonathan Creekmore <[email protected]>

Signature · 1 line
Doug Goldstein

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

Acked-by on v1 1/1
#4 lore raw
In reply to Dario Faggioli
Quoted 10 lines · Dario Faggioli

instead of just the first scheduler we find in the array.

In fact, right now, if someone makes a typo when passing the "sched=" command line option to Xen, we (with all schedulers configured in) pick ARINC653, which is most likely not what one would expect.

Go for the default scheduler instead.

I'll check it in here shortly.

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

#5 lore raw
In reply to Dario Faggioli
Quoted 10 lines · Dario Faggioli

instead of just the first scheduler we find in the array.

In fact, right now, if someone makes a typo when passing the "sched=" command line option to Xen, we (with all schedulers configured in) pick ARINC653, which is most likely not what one would expect.

Go for the default scheduler instead.

Quoted 9 lines

---
Cc: George Dunlap <[email protected]>
Cc: Jan Beulich <[email protected]>
Cc: Doug Goldstein <[email protected]>
Cc: Jonathan Creekmore <[email protected]>
---
I don't think I'm going to ask for this to be put in 4.7, as I don't want to give Wei an heart attack... :-)

I will just say "Meh, let's backport this." :-P

Quoted 21 lines

Considering it for backporting should be enough, IMO.

---
 xen/common/schedule.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/common/schedule.c +2 -1
index 5e35310..7ac12d3 100644
@@ -1625,7 +1625,8 @@ void __init scheduler_init(void)
     {
         printk("Could not find scheduler: %s\n", opt_sched);
         for ( i = 0; i < NUM_SCHEDULERS; i++ )
-            if ( schedulers[i] )
+            if ( schedulers[i] &&
+                 !strcmp(schedulers[i]->opt_name, CONFIG_SCHED_DEFAULT) )
             {
                 ops = *schedulers[i];
                 break;
Quoted 4 lines

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

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