Commit 8e17c72c authored by Zhao Wenhui's avatar Zhao Wenhui
Browse files

sched/fair: Fix qos_timer deadlock when cpuhp offline

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8YHBT



--------------------------------

When cpu hotplug offline, if qos_overload_timer_handler() concurrently
running, It could trigger an ABBA deadlock. As qos_overload_timer_handler()
requires rq lock, while the cpu hotplug attached firstly and waiting for
the qos_timer handling, This can cause Hard LOCKUP like:

[359230.788754] Call trace:
[359230.788755] hrtimer_active+0x7c/0xec
[359230.788757] hrtimer_cancel+0x3c/0x60
[359230.788758] unthrottle_qos_cfs_rqs+0xbc/0x110
[359230.788760] unthrottle_offline_cfs_rqs+0x40/0x150
[359230.788762] rq_offline_fair+0x60/0x70
[359230.788764] set_rq_offline.part.0+0x54/0xf4
[359230.788765] set_rq_offline+0x34/0x44
[359230.788767] rq_attach_root+0x1e8/0x260
[359230.788768] cpu_attach_domain+0x244/0x430
[359230.788770] detach_destroy_domains+0xbc/0x140
[359230.788772] partition_sched_domains_locked+0x23c/0x314
[359230.788774] rebuild_sched_domains_locked+0x1f0/0x270
[359230.788776] cpuset_hotplug_workfn+0x514/0x74c
[359230.788777] process_one_work+0x34c/0x800
[359230.788779] worker_thread+0xa8/0x500
[359230.788780] kthread+0x1e0/0x220
[359230.788782] ret_from_fork+0x10/0x18
[359230.788783] Kernel panic - not syncing: Hard LOCKUP

Fix it by switch to use __unthrottle_qos_cfs_rqs(), instead of
unthrottle_qos_cfs_rqs() in unthrottle_offline_cfs_rqs, so that
it will not trigger cancel_qos_timer() when cpu hotplug offline.

Fixes: 453eaea6 ("sched/qos: Add qos_tg_{throttle,unthrottle}_{up,down}")
Signed-off-by: default avatarZhao Wenhui <zhaowenhui8@huawei.com>
parent 0ff07578
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment