diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-02-16 22:15:30 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-02-22 01:25:22 +0100 |
commit | 3bfe6106693b6b4ba175ad1f929c4660b8f59ca8 (patch) | |
tree | aba6783414bf41a0274cc07c5cf4d11912de3ba6 /fs/io-wq.h | |
parent | kernel: treat PF_IO_WORKER like PF_KTHREAD for ptrace/signals (diff) | |
download | linux-3bfe6106693b6b4ba175ad1f929c4660b8f59ca8.tar.xz linux-3bfe6106693b6b4ba175ad1f929c4660b8f59ca8.zip |
io-wq: fork worker threads from original task
Instead of using regular kthread kernel threads, create kernel threads
that are like a real thread that the task would create. This ensures that
we get all the context that we need, without having to carry that state
around. This greatly reduces the code complexity, and the risk of missing
state for a given request type.
With the move away from kthread, we can also dump everything related to
assigned state to the new threads.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r-- | fs/io-wq.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h index d2cf284b4641..83d56adabd16 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -137,6 +137,7 @@ 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); + return in_task() && (current->flags & PF_IO_WORKER) && + current->pf_io_worker; } #endif |