diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2021-12-22 22:10:09 -0600 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2022-01-08 09:39:49 -0600 |
commit | e32cf5dfbe227b355776948b2c9b5691b84d1cbd (patch) | |
tree | c00df29e5a3bf47010fbdf5e5dbaa20325b7d1a6 /fs/io-wq.h | |
parent | 00580f03af5eb2a527875b4a80a5effd95bda2fa (diff) | |
download | linux-stable-e32cf5dfbe227b355776948b2c9b5691b84d1cbd.tar.gz linux-stable-e32cf5dfbe227b355776948b2c9b5691b84d1cbd.tar.bz2 linux-stable-e32cf5dfbe227b355776948b2c9b5691b84d1cbd.zip |
kthread: Generalize pf_io_worker so it can point to struct kthread
The point of using set_child_tid to hold the kthread pointer was that
it already did what is necessary. There are now restrictions on when
set_child_tid can be initialized and when set_child_tid can be used in
schedule_tail. Which indicates that continuing to use set_child_tid
to hold the kthread pointer is a bad idea.
Instead of continuing to use the set_child_tid field of task_struct
generalize the pf_io_worker field of task_struct and use it to hold
the kthread pointer.
Rename pf_io_worker (which is a void * pointer) to worker_private so
it can be used to store kthreads struct kthread pointer. Update the
kthread code to store the kthread pointer in the worker_private field.
Remove the places where set_child_tid had to be dealt with carefully
because kthreads also used it.
Link: https://lkml.kernel.org/r/CAHk-=wgtFAA9SbVYg0gR1tqPMC17-NYcs0GQkaYg1bGhh1uJQQ@mail.gmail.com
Link: https://lkml.kernel.org/r/87a6grvqy8.fsf_-_@email.froward.int.ebiederm.org
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r-- | fs/io-wq.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index 41bf37674a49..c7c23947cbcd 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -200,6 +200,6 @@ static inline void io_wq_worker_running(struct task_struct *tsk) static inline bool io_wq_current_is_worker(void) { return in_task() && (current->flags & PF_IO_WORKER) && - current->pf_io_worker; + current->worker_private; } #endif |