PM / devfreq: Make the monitor workqueue high priority

Running the devfreq monitor in a normal-priority workqueue can result
in the devfreq mutex lock being held for a while when the monitor
worker sleeps inside update_devfreq(). Freeing up the devfreq mutex
lock is important to ensure timely devfreq boosts, so run the monitor
workqueue in a high-priority workqueue to reduce the lock duration.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
This commit is contained in:
Sultan Alsawaf 2021-01-24 18:02:24 -08:00 committed by Ksawlii
parent bd260c10fc
commit cb79672815

View file

@ -1906,7 +1906,8 @@ static int __init devfreq_init(void)
return PTR_ERR(devfreq_class);
}
devfreq_wq = create_freezable_workqueue("devfreq_wq");
devfreq_wq = alloc_workqueue("devfreq_wq", WQ_HIGHPRI | WQ_FREEZABLE |
WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
if (!devfreq_wq) {
class_destroy(devfreq_class);
pr_err("%s: couldn't create workqueue\n", __FILE__);