mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen/sched: fix get_cpu_idle_time() for smt=0 suspend/resume
With smt=0 during a suspend/resume cycle of the machine the threads which have been parked before will briefly come up again. This can result in problems e.g. with cpufreq driver being active as this will call into get_cpu_idle_time() for a cpu without initialized scheduler data. Fix that by letting get_cpu_idle_time() deal with this case. Drop a redundant check in exchange. Fixes:132cbe8f35("sched: fix get_cpu_idle_time() with core scheduling") Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Signed-off-by: Juergen Gross <jgross@suse.com> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Dario Faggioli <dfaggioli@suse.com> master commit:5293470a77master date: 2021-08-19 13:38:31 +0200
This commit is contained in:
1 parent
d1e1921736
commit
6dda306223
1 file changed
+1
-1
@@ -334,7 +334,7 @@ uint64_t get_cpu_idle_time(unsigned int cpu)
|
||||
struct vcpu_runstate_info state = { 0 };
|
||||
struct vcpu *v = idle_vcpu[cpu];
|
||||
|
||||
if ( cpu_online(cpu) && v )
|
||||
if ( cpu_online(cpu) && get_sched_res(cpu) )
|
||||
vcpu_runstate_get(v, &state);
|
||||
|
||||
return state.time[RUNSTATE_running];
|
||||
|
||||