[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging-4.13] xen/sched: fix get_cpu_idle_time() for smt=0 suspend/resume
commit 6dda306223a2dd86ec2847d87a4a2ef8170d5fe0 Author: Juergen Gross <jgross@xxxxxxxx> AuthorDate: Wed Aug 25 15:28:49 2021 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Wed Aug 25 15:28:49 2021 +0200 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: 132cbe8f35632fb2 ("sched: fix get_cpu_idle_time() with core scheduling") Reported-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Juergen Gross <jgross@xxxxxxxx> Tested-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Acked-by: Dario Faggioli <dfaggioli@xxxxxxxx> master commit: 5293470a77ad980dce2af9b7e6c3f11eeebf1b64 master date: 2021-08-19 13:38:31 +0200 --- xen/common/schedule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/schedule.c b/xen/common/schedule.c index a698a13698..8ccdb2c4d8 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -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]; -- generated by git-patchbot for /home/xen/git/xen.git#staging-4.13
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |