lkml.org 
[lkml]   [2022]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC PATCH v2 0/2] workqueue: destroy_worker() vs isolated CPUs
Date
Hi folks,

Using a work struct from within the workqueue code itself is a bit scary, but
I've done more rigorous testing than for v1 and it's looking OK (at the very
least locking-wise).

Note that this affects all kworkers (not just percpu ones) for the sake of
consistency and to prevent adding extra corner cases. kthread_set_per_cpu(p, -1)
is a no-op for unbound kworkers, and IIUC the affinity change is not required
since unbound workers have to be affined to a subset of wq_unbound_cpumask, but
it shouldn't be harmful either.

2/2 is a simple and stupid stresser that forces extra pcpu kworkers to be
spawned on a specific CPU - I can then quickly test this on QEMU by making sure
said CPU is isolated on the cmdline.

Thanks to Tejun & Lai for the discussion thus far.

Revisions
=========

RFCv1 -> RFCv2
++++++++++++++

o Change the pool->timer into a delayed_work to have a sleepable context for
unbinding kworkers

Cheers,
Valentin

Valentin Schneider (2):
workqueue: Unbind workers before sending them to exit()
DEBUG: workqueue: kworker spawner

kernel/Makefile | 2 +-
kernel/workqueue.c | 118 ++++++++++++++++++++++++++++++++++-----------
kernel/wqstress.c | 69 ++++++++++++++++++++++++++
3 files changed, 159 insertions(+), 30 deletions(-)
create mode 100644 kernel/wqstress.c

--
2.31.1

\
 
 \ /
  Last update: 2022-07-27 13:54    [W:0.062 / U:0.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site