Skip to content

kthread: remove worker->task self-assignment

Bradley Morgan linux-media linux-pm linux-serial lkml netdev 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/25 patches 0 repliesNew
  2. v1 posting 1/21 patch 0 repliesSuperseded

Patches in v1 posting 2/2 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 -100 replies
1/5media: ivtv: convert to kthread_run_workerdrivers/media/pci/ivtv/ivtv-driver.c drivers/media/pci/ivtv/ivtv-driver.h+7 -100 replies
2/5net: encx24j600: convert to kthread_run_workerdrivers/net/ethernet/microchip/encx24j600.c+8 -120 replies
2/5net: encx24j600: convert to kthread_run_workerdrivers/net/ethernet/microchip/encx24j600.c+8 -120 replies
3/5tty: sc16is7xx: convert to kthread_run_workerdrivers/tty/serial/sc16is7xx.c+18 -210 replies
3/5tty: sc16is7xx: convert to kthread_run_workerdrivers/tty/serial/sc16is7xx.c+18 -210 replies
4/5cpufreq: schedutil: convert to kthread_create_workerkernel/sched/cpufreq_schedutil.c+14 -190 replies
4/5cpufreq: schedutil: convert to kthread_create_workerkernel/sched/cpufreq_schedutil.c+14 -190 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RESEND PATCH 0/5] kthread: remove worker->task self-assignment

From: Bradley Morgan <[email protected]>

Resent as a proper series with cover letter. The first send went out as five separate threads instead of one.

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 even starts, so the self-assignment is dead code.

Four drivers were still on the old API. Convert them, then remove the FIXME.

No functional change intended.

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    | 11 ++++-------
 drivers/media/pci/ivtv/ivtv-driver.h    |  3 +--
 drivers/net/ethernet/microchip/encx24j600.c | 12 ++++--------
 drivers/tty/serial/sc16is7xx.c        | 17 +++++++----------
 kernel/sched/cpufreq_schedutil.c       | 14 +++++--------
 kernel/kthread.c                      |  7 -------
 6 files changed, 21 insertions(+), 63 deletions(-)