workqueue: Kick a worker based on the actual activation of delayed works
authorYunfeng Ye <yeyunfeng@huawei.com>
Thu, 19 Nov 2020 06:21:25 +0000 (14:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jan 2021 19:18:14 +0000 (20:18 +0100)
commitdfec7dc891d7f1c336c16b3198c950fcd31607bc
treeacf469a7d715d3d094961dc04e06057f97a4de2d
parentbfb39e6d67a5fb3875e0cfb2e108e4bcc56d7747
workqueue: Kick a worker based on the actual activation of delayed works

[ Upstream commit 01341fbd0d8d4e717fc1231cdffe00343088ce0b ]

In realtime scenario, We do not want to have interference on the
isolated cpu cores. but when invoking alloc_workqueue() for percpu wq
on the housekeeping cpu, it kick a kworker on the isolated cpu.

  alloc_workqueue
    pwq_adjust_max_active
      wake_up_worker

The comment in pwq_adjust_max_active() said:
  "Need to kick a worker after thawed or an unbound wq's
   max_active is bumped"

So it is unnecessary to kick a kworker for percpu's wq when invoking
alloc_workqueue(). this patch only kick a worker based on the actual
activation of delayed works.

Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/workqueue.c