Skip to contentSkip to conversation

Avoid panic when adjusting sedf parameters

PATCH In review Juergen Gross 2 participants 3 messages Nov 17, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Avoid panic when adjusting sedf parameters

When using sedf scheduler in a cpupool the system might panic when setting sedf scheduling parameters for a domain.

Signed-off-by [email protected]
1 file changed, 4 insertions(+)

xen/common/sched_sedf.c | 4 ++++

# HG changeset patch
# User Juergen Gross <[email protected]> # Date 1321533195 -3600
# Node ID 7167eaa187b3cd996637b1f995707ff9196d00d3 # Parent fd3567cafe1c7ccd0ddba0ad7fb067d435e13529 Avoid panic when adjusting sedf parameters

When using sedf scheduler in a cpupool the system might panic when setting sedf scheduling parameters for a domain.

Signed-off-by [email protected]
xen/common/sched_sedf.c +4 -0
diff -r fd3567cafe1c -r 7167eaa187b3 xen/common/sched_sedf.c
@@ -1304,6 +1304,8 @@ static void sedf_dump_cpu_state(const st
     rcu_read_lock(&domlist_read_lock);
     for_each_domain ( d )
     {
+        if ( (d->cpupool ? d->cpupool->sched : &sched_sedf_def) != ops )
+            continue;
         for_each_vcpu(d, ed)
         {
             if ( !__task_on_queue(ed) && (ed->processor == i) )
@@ -1369,6 +1371,8 @@ static int sedf_adjust_weights(struct cp
     rcu_read_lock(&domlist_read_lock);
     for_each_domain( d )
     {
+        if ( c != d->cpupool )
+            continue;
         for_each_vcpu ( d, p )
         {
             if ( (cpu = p->processor) >= nr_cpus )

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

#1 lore raw
Quoted 2 lines · Juergen Gross

When using sedf scheduler in a cpupool the system might panic when setting sedf scheduling parameters for a domain.

The cpupool structures keep track of which domain is in which pool, right? I wonder if a more elegant solution might be to make a for_each_domain_cpupool() macro.

Just an idea, not a NACK; if you don't think my idea is good / don't have time / inclination to do it now, I'm fine with this patch..

-George

Quoted 15 lines
Signed-off-by [email protected]
1 file changed, 4 insertions(+)

xen/common/sched_sedf.c |    4 ++++

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

#2 lore raw
Quoted 10 lines · George Dunlap
Quoted 2 lines · Juergen Gross

When using sedf scheduler in a cpupool the system might panic when setting sedf scheduling parameters for a domain.

The cpupool structures keep track of which domain is in which pool, right? I wonder if a more elegant solution might be to make a for_each_domain_cpupool() macro.

Just an idea, not a NACK; if you don't think my idea is good / don't have time / inclination to do it now, I'm fine with this patch..

Good idea. New patch coming soon.

Juergen

Signature · 5 lines
Juergen Gross                 Principal Developer Operating Systems
PDG ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: [email protected]
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html