Skip to content

kthread: don't abuse kthread_create_on_cpu() in __kthread_create_worker()

Oleg Nesterov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1kthread: don't abuse kthread_create_on_cpu() in __kthread_create_worker()kernel/kthread.c+8 -151 reply

Reviews trailers per patch

The patch has a Reviewed-by or Acked-by.

PatchPetr Mladek
1/1R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/1] kthread: don't abuse kthread_create_on_cpu() in __kthread_create_worker()
Quoted 10 lines · Oleg Nesterov

Yes, agreed. Again, I'll write another email. Perhaps we should even keep park/unpark exported and change them to avoid the races with exit/itself, I dunno.

My real point was, imo the KTHREAD_IS_PER_CPU/__kthread_bind(kthread->cpu) logic in kthread_unpark() should be private to smpboot.c/cpu.c.

I'll send another patch tomorrow. kthread_create_worker_on_cpu() ab-uses this logic too for no reason, but this is trivial.

After this change we are almost ready to kill kthread->cpu and KTHREAD_IS_PER_CPU. (but the change itself doesn't depend on the previous patches).

Petr, why do we need kthread_create_worker_on_cpu() ? It has no users and I can not imagine any "real" use-case for it. Perhaps it can be removed?

Oleg.