linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] workqueue: cleanups for schedule callbacks
@ 2021-12-07  7:35 Lai Jiangshan
  2021-12-07  7:35 ` [PATCH 1/7] workqueue: Remove the outdated comment before wq_worker_sleeping() Lai Jiangshan
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Lai Jiangshan @ 2021-12-07  7:35 UTC (permalink / raw)
  To: linux-kernel, Tejun Heo; +Cc: Lai Jiangshan

From: Lai Jiangshan <laijs@linux.alibaba.com>

The commit 6d25be5782e4 ("sched/core, workqueues: Distangle worker
accounting from rq lock") changed the schedule callbacks for workqueue.

It simplified the connection between scheduler and workqueue.  But it
caused some code uselss and some comments outdated in workqueue.  This
patchset clean them up.

Patch1 is unrelated to 6d25be5782e4, it is related to a recent change
to make wq_worker_sleeping() not being called in preempt disabled
section.

Patch2 is cleanup for 6d25be5782e4 not calling schedule callbacks in
deeper sleeping path with local-wake-up fashion.

Patch3 is unrelated to 6d25be5782e4, but weakly prepared for patch4.

Patch4-6 are cleanup for 6d25be5782e4 not calling schedule callbacks in
wakeup code, so cacheline_aligned for nr_running and schedule() in
unbind_workers() is unneeded.

6d25be5782e4 also changed to use pool lock in wq_worker_sleeping(),
and patch 7 changes it back to use preemption disabling.  This patch is
marked for 'RFC' because using pool lock in slow (sleeping) path is OK
for me and paves the road to remove "X:" protection.

There are several further cleanups depended on if patch7 is accepted or
not.  For example, mb() in insert_work() can be removed if pool lock
wins.

Lai Jiangshan (7):
  workqueue: Remove the outdated comment before wq_worker_sleeping()
  workqueue: Remove the advanced kicking of the idle workers in
    rebind_workers()
  workqueue: Remove outdated comment about exceptional workers in
    unbind_workers()
  workqueue: Remove schedule() in unbind_workers()
  workqueue: Move the code of waking a worker up in unbind_workers()
  workqueue: Remove the cacheline_aligned for nr_running
  workqueue: Replace pool lock with preemption disabling in
    wq_worker_sleeping()

 kernel/workqueue.c | 102 +++++++++++++++++----------------------------
 1 file changed, 38 insertions(+), 64 deletions(-)

-- 
2.19.1.6.gb485710b


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-12-09 23:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07  7:35 [PATCH 0/7] workqueue: cleanups for schedule callbacks Lai Jiangshan
2021-12-07  7:35 ` [PATCH 1/7] workqueue: Remove the outdated comment before wq_worker_sleeping() Lai Jiangshan
2021-12-07  7:35 ` [PATCH 2/7] workqueue: Remove the advanced kicking of the idle workers in rebind_workers() Lai Jiangshan
2021-12-07  7:35 ` [PATCH 3/7] workqueue: Remove outdated comment about exceptional workers in unbind_workers() Lai Jiangshan
2021-12-09 22:16   ` Tejun Heo
2021-12-07  7:35 ` [PATCH 4/7] workqueue: Remove schedule() " Lai Jiangshan
2021-12-07  7:35 ` [PATCH 5/7] workqueue: Move the code of waking a worker up " Lai Jiangshan
2021-12-07  7:35 ` [PATCH 6/7] workqueue: Remove the cacheline_aligned for nr_running Lai Jiangshan
2021-12-09 22:07   ` Tejun Heo
2021-12-09 23:31     ` Lai Jiangshan
2021-12-09 22:27   ` Tejun Heo
2021-12-07  7:35 ` [RFC PATCH 7/7] workqueue: Replace pool lock with preemption disabling in wq_worker_sleeping() Lai Jiangshan
2021-12-09 22:14   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).