[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/sched: fix schedule_dump() handling of free cpus



commit f38e8cb85aa7e04b737482b2f4eeb9d6d40a2e61
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Wed Jul 29 14:06:43 2026 +0200
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Jul 29 14:41:22 2026 +0100

    xen/sched: fix schedule_dump() handling of free cpus
    
    With the introduction of core scheduling, cpus not used by any cpupool
    have been switched to use the very simple idle scheduler instead of the
    default scheduler.
    
    Trying to obtain diagnostic scheduling data via the "r" debug key is
    scanning through all cpupools using the per-cpupool scheduler to print
    the related data. Unfortunately the switch to use the idle scheduler
    for free cpus wasn't reflected in schedule_dump(), causing the default
    scheduler's dump_cpu_state callback to be used for free cpus.
    
    This causes NULL dereferences in case the default scheduler is one of
    credit or null.
    
    Fix that by using the idle scheduler instead of the default scheduler
    for free cpus. Note that it is fine for a scheduler to have no
    dump_cpu_state callback.
    
    Fixes: f855dd962523 ("sched: add minimalistic idle scheduler for free cpus")
    Reported-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxx>
    Tested-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxx>
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 55b71301cf..9ccf5811bf 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -3452,7 +3452,7 @@ void schedule_dump(struct cpupool *c)
     }
     else
     {
-        sched = &operations;
+        sched = &sched_idle_ops;
         cpus = &cpupool_free_cpus;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.