Pavel Begunkov c60eb049f4 io-wq: cancel unbounded works on io-wq destroy
WARNING: CPU: 5 PID: 227 at fs/io_uring.c:8578 io_ring_exit_work+0xe6/0x470
RIP: 0010:io_ring_exit_work+0xe6/0x470
Call Trace:
 process_one_work+0x206/0x400
 worker_thread+0x4a/0x3d0
 kthread+0x129/0x170
 ret_from_fork+0x22/0x30

INFO: task lfs-openat:2359 blocked for more than 245 seconds.
task:lfs-openat      state:D stack:    0 pid: 2359 ppid:     1 flags:0x00000004
Call Trace:
 ...
 wait_for_completion+0x8b/0xf0
 io_wq_destroy_manager+0x24/0x60
 io_wq_put_and_exit+0x18/0x30
 io_uring_clean_tctx+0x76/0xa0
 __io_uring_files_cancel+0x1b9/0x2e0
 do_exit+0xc0/0xb40
 ...

Even after io-wq destroy has been issued io-wq worker threads will
continue executing all left work items as usual, and may hang waiting
for I/O that won't ever complete (aka unbounded).

[<0>] pipe_read+0x306/0x450
[<0>] io_iter_do_read+0x1e/0x40
[<0>] io_read+0xd5/0x330
[<0>] io_issue_sqe+0xd21/0x18a0
[<0>] io_wq_submit_work+0x6c/0x140
[<0>] io_worker_handle_work+0x17d/0x400
[<0>] io_wqe_worker+0x2c0/0x330
[<0>] ret_from_fork+0x22/0x30

Cancel all unbounded I/O instead of executing them. This changes the
user visible behaviour, but that's inevitable as io-wq is not per task.

Suggested-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/cd4b543154154cba055cf86f351441c2174d7f71.1617842918.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-04-08 13:33:17 -06:00
..
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:27:20 +01:00
2021-03-05 12:21:14 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-28 11:23:38 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:23:38 -08:00
2021-02-28 11:23:38 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:45:25 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:23:38 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-02-27 08:29:02 -08:00
2021-03-05 17:21:25 -08:00
2021-02-24 13:38:26 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2020-09-10 14:03:31 -07:00
2021-01-24 14:27:20 +01:00
2021-02-23 13:39:45 -08:00
2021-02-28 11:45:25 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:20 +01:00
2021-01-24 14:27:20 +01:00
2021-02-28 11:23:38 -08:00
2021-02-26 09:41:05 -08:00
2021-02-24 13:38:26 -08:00
2021-02-28 11:23:38 -08:00
2021-02-24 13:38:26 -08:00
2021-02-23 13:39:45 -08:00
2021-01-24 14:27:19 +01:00
2021-02-23 13:39:45 -08:00
2021-04-08 13:32:59 -06:00
2020-07-31 08:16:01 +02:00
2021-02-21 10:22:20 -08:00
2021-02-23 13:39:45 -08:00
2021-01-29 10:06:46 +05:30
2021-02-26 15:49:51 -07:00
2021-02-23 13:39:45 -08:00
2021-02-23 13:39:45 -08:00
2021-02-24 13:38:26 -08:00
2021-01-24 14:27:20 +01:00
2020-07-31 08:16:00 +02:00
2021-01-24 14:27:19 +01:00
2021-01-21 14:06:00 -07:00
2021-02-21 11:02:48 -08:00
2021-01-24 14:27:20 +01:00
2021-02-13 17:17:53 +01:00
2020-06-09 15:40:50 -07:00
2021-01-24 14:27:18 +01:00