From cb796728155e4f62b3bf27f2e500f36681f385b7 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Sun, 24 Jan 2021 18:02:24 -0800 Subject: [PATCH] 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 Signed-off-by: celtare21 --- drivers/devfreq/devfreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index e095adcc5..1b19bf84c 100755 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -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__);