Skip to content

kthread: convert remaining users to kthread_create_worker

Bradley Morgan linux-media linux-pm linux-serial lkml llvm netdev oe-kbuild-all sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest5 patches 14 repliesIn review

Changes in v2 from the cover letter

- Keep WARN_ON() as a bare sanity check (Frederic, Peter)
- Add comment explaining why the WARN_ON() is there
- Fix subject and changelog wording

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5media: ivtv: convert to kthread_run_workerdrivers/media/pci/ivtv/ivtv-driver.c drivers/media/pci/ivtv/ivtv-driver.h+7 -102 replies
2/5net: encx24j600: convert to kthread_run_workerdrivers/net/ethernet/microchip/encx24j600.c+8 -121 reply
3/5tty: sc16is7xx: convert to kthread_run_workerdrivers/tty/serial/sc16is7xx.c+18 -211 reply
4/5cpufreq: schedutil: convert to kthread_create_workerkernel/sched/cpufreq_schedutil.c+14 -190 replies
5/5kthread: remove worker->task self assignmentkernel/kthread.c+3 -52 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/5] kthread: convert remaining users to kthread_create_worker

kthread_worker_fn() has carried a FIXME for a decade: it assigns worker->task = current because the old kthread_run(kthread_worker_fn) callers never told the worker what task it was. The new kthread_create_worker*() API sets worker->task before the worker starts, so the self assignment is dead code.

This series converts the four remaining users of the old pattern (ivtv, encx24j600, sc16is7xx, cpufreq_schedutil) to the new API, then removes the self assignment from kthread_worker_fn() while keeping a WARN_ON() as a sanity check for any out-of-tree users.

v1 -> v2:
- Keep WARN_ON() as a bare sanity check (Frederic, Peter)
- Add comment explaining why the WARN_ON() is there
- Fix subject and changelog wording

Bradley Morgan (5):
media: ivtv: convert to kthread_run_worker
net: encx24j600: convert to kthread_run_worker
tty: sc16is7xx: convert to kthread_run_worker
cpufreq: schedutil: convert to kthread_create_worker
kthread: remove worker->task self assignment

 drivers/media/pci/ivtv/ivtv-driver.c        | 14 ++++----
 drivers/media/pci/ivtv/ivtv-driver.h        |  3 +-
 drivers/net/ethernet/microchip/encx24j600.c | 20 +++++------
 drivers/tty/serial/sc16is7xx.c              | 39 ++++++++++-----------
 kernel/kthread.c                            |  8 ++---
 kernel/sched/cpufreq_schedutil.c            | 33 ++++++++---------
 6 files changed, 50 insertions(+), 67 deletions(-)
Signature · 1 line
2.47.3