Hao Xu
6195ba0982
io_uring: fix flush cqring overflow list while TASK_INTERRUPTIBLE
...
Abaci reported the follow warning:
[ 27.073425] do not call blocking ops when !TASK_RUNNING; state=1 set at [] prepare_to_wait_exclusive+0x3a/0xc0
[ 27.075805] WARNING: CPU: 0 PID: 951 at kernel/sched/core.c:7853 __might_sleep+0x80/0xa0
[ 27.077604] Modules linked in:
[ 27.078379] CPU: 0 PID: 951 Comm: a.out Not tainted 5.11.0-rc3+ #1
[ 27.079637] Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
[ 27.080852] RIP: 0010:__might_sleep+0x80/0xa0
[ 27.081835] Code: 65 48 8b 04 25 80 71 01 00 48 8b 90 c0 15 00 00 48 8b 70 18 48 c7 c7 08 39 95 82 c6 05 f9 5f de 08 01 48 89 d1 e8 00 c6 fa ff 0b eb bf 41 0f b6 f5 48 c7 c7 40 23 c9 82 e8 f3 48 ec 00 eb a7
[ 27.084521] RSP: 0018:ffffc90000fe3ce8 EFLAGS: 00010286
[ 27.085350] RAX: 0000000000000000 RBX: ffffffff82956083 RCX: 0000000000000000
[ 27.086348] RDX: ffff8881057a0000 RSI: ffffffff8118cc9e RDI: ffff88813bc28570
[ 27.087598] RBP: 00000000000003a7 R08: 0000000000000001 R09: 0000000000000001
[ 27.088819] R10: ffffc90000fe3e00 R11: 00000000fffef9f0 R12: 0000000000000000
[ 27.089819] R13: 0000000000000000 R14: ffff88810576eb80 R15: ffff88810576e800
[ 27.091058] FS: 00007f7b144cf740(0000) GS:ffff88813bc00000(0000) knlGS:0000000000000000
[ 27.092775] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 27.093796] CR2: 00000000022da7b8 CR3: 000000010b928002 CR4: 00000000003706f0
[ 27.094778] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 27.095780] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 27.097011] Call Trace:
[ 27.097685] __mutex_lock+0x5d/0xa30
[ 27.098565] ? prepare_to_wait_exclusive+0x71/0xc0
[ 27.099412] ? io_cqring_overflow_flush.part.101+0x6d/0x70
[ 27.100441] ? lockdep_hardirqs_on_prepare+0xe9/0x1c0
[ 27.101537] ? _raw_spin_unlock_irqrestore+0x2d/0x40
[ 27.102656] ? trace_hardirqs_on+0x46/0x110
[ 27.103459] ? io_cqring_overflow_flush.part.101+0x6d/0x70
[ 27.104317] io_cqring_overflow_flush.part.101+0x6d/0x70
[ 27.105113] io_cqring_wait+0x36e/0x4d0
[ 27.105770] ? find_held_lock+0x28/0xb0
[ 27.106370] ? io_uring_remove_task_files+0xa0/0xa0
[ 27.107076] __x64_sys_io_uring_enter+0x4fb/0x640
[ 27.107801] ? rcu_read_lock_sched_held+0x59/0xa0
[ 27.108562] ? lockdep_hardirqs_on_prepare+0xe9/0x1c0
[ 27.109684] ? syscall_enter_from_user_mode+0x26/0x70
[ 27.110731] do_syscall_64+0x2d/0x40
[ 27.111296] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 27.112056] RIP: 0033:0x7f7b13dc8239
[ 27.112663] Code: 01 00 48 81 c4 80 00 00 00 e9 f1 fe ff ff 0f 1f 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 3d 01 f0 ff ff 73 01 c3 48 8b 0d 27 ec 2c 00 f7 d8 64 89 01 48
[ 27.115113] RSP: 002b:00007ffd6d7f5c88 EFLAGS: 00000286 ORIG_RAX: 00000000000001aa
[ 27.116562] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7b13dc8239
[ 27.117961] RDX: 000000000000478e RSI: 0000000000000000 RDI: 0000000000000003
[ 27.118925] RBP: 00007ffd6d7f5cb0 R08: 0000000020000040 R09: 0000000000000008
[ 27.119773] R10: 0000000000000001 R11: 0000000000000286 R12: 0000000000400480
[ 27.120614] R13: 00007ffd6d7f5d90 R14: 0000000000000000 R15: 0000000000000000
[ 27.121490] irq event stamp: 5635
[ 27.121946] hardirqs last enabled at (5643): [] console_unlock+0x5c4/0x740
[ 27.123476] hardirqs last disabled at (5652): [] console_unlock+0x4e7/0x740
[ 27.125192] softirqs last enabled at (5272): [] __do_softirq+0x3c5/0x5aa
[ 27.126430] softirqs last disabled at (5267): [] asm_call_irq_on_stack+0xf/0x20
[ 27.127634] ---[ end trace 289d7e28fa60f928 ]---
This is caused by calling io_cqring_overflow_flush() which may sleep
after calling prepare_to_wait_exclusive() which set task state to
TASK_INTERRUPTIBLE
Reported-by: Abaci <abaci@linux.alibaba.com>
Fixes: 6c503150ae33 ("io_uring: patch up IOPOLL overflow_flush sync")
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2021-01-27 09:18:28 -07:00
..
2020-12-21 10:28:02 -08:00
2020-10-24 12:26:05 -07:00
2020-10-24 12:26:05 -07:00
2021-01-04 12:25:19 +00:00
2020-12-10 12:42:59 -06:00
2020-09-18 16:45:50 -04:00
2020-12-15 22:46:18 -08:00
2021-01-20 14:15:33 -08:00
2021-01-20 11:33:51 -08:00
2021-01-04 17:31:32 +01:00
2021-01-23 01:28:20 -06:00
2020-05-05 09:22:21 -06:00
2020-11-14 10:22:45 +01:00
2020-09-18 16:45:50 -04:00
2020-12-17 11:18:00 -08:00
2020-10-30 08:37:39 +01:00
2020-11-10 12:14:20 -06:00
2020-08-07 11:33:22 -07:00
2020-11-25 16:55:02 +01:00
2020-09-18 16:45:50 -04:00
2020-12-10 11:07:40 +08:00
2020-12-22 12:31:17 +09:00
2020-12-09 09:39:38 -05:00
2020-11-23 10:36:53 +01:00
2021-01-15 14:54:24 -08:00
2020-12-17 11:18:00 -08:00
2020-09-18 16:45:50 -04:00
2020-06-03 16:27:18 -07:00
2020-12-10 15:33:14 +01:00
2020-12-03 17:04:41 +01:00
2020-10-29 17:22:59 -05:00
2020-10-29 17:22:59 -05:00
2020-12-21 21:42:29 -05:00
2020-09-18 16:45:50 -04:00
2020-08-12 10:57:56 -07:00
2020-12-02 18:28:05 -08:00
2020-10-29 17:22:59 -05:00
2020-12-17 13:30:45 -05:00
2020-12-13 21:57:21 +01:00
2020-11-13 16:03:07 -06:00
2021-01-21 18:30:28 +01:00
2020-12-16 07:57:37 -05:00
2020-09-18 16:45:50 -04:00
2021-01-10 16:29:28 -05:00
2020-12-09 09:38:34 -05:00
2021-01-12 08:54:14 -05:00
2020-12-15 22:46:17 -08:00
2020-06-14 01:57:21 +09:00
2020-12-28 11:58:59 +01:00
2020-12-15 12:13:37 -08:00
2020-12-15 12:13:37 -08:00
2020-09-22 23:39:45 -04:00
2020-12-16 16:14:08 -05:00
2020-12-14 15:26:14 +01:00
2021-01-24 10:34:53 -08:00
2020-12-17 13:22:17 -08:00
2020-09-18 16:45:50 -04:00
2020-09-18 16:45:50 -04:00
2020-12-17 11:00:37 -08:00
2020-10-16 11:11:22 -07:00
2020-11-26 16:57:28 +01:00
2020-10-24 12:26:05 -07:00
2020-10-24 12:26:05 -07:00
2020-10-02 12:02:30 +02:00
2020-09-18 16:45:50 -04:00
2020-12-17 17:46:34 -08:00
2021-01-18 12:06:33 +01:00
2020-10-24 12:26:05 -07:00
2020-09-10 14:03:31 -07:00
2020-10-15 15:11:56 -07:00
2020-12-14 12:18:19 -08:00
2020-12-18 12:50:18 -08:00
2021-01-04 09:06:42 +09:00
2020-12-15 12:53:37 -08:00
2020-06-03 23:16:55 -04:00
2020-05-07 16:55:47 -05:00
2020-10-16 11:11:21 -07:00
2020-12-15 19:29:43 -08:00
2020-06-04 19:18:29 -07:00
2020-08-24 08:49:13 +10:00
2020-06-04 19:18:29 -07:00
2020-06-04 19:18:29 -07:00
2021-01-07 20:57:53 -07:00
2020-12-16 12:57:51 -08:00
2020-05-14 16:44:23 +02:00
2020-10-26 13:46:47 +01:00
2020-12-15 19:29:43 -08:00
2020-10-14 14:54:45 -07:00
2020-12-15 22:46:19 -08:00
2020-12-10 17:33:17 -05:00
2020-10-15 15:03:10 -07:00
2020-04-27 02:07:40 -04:00
2020-11-15 09:49:10 -05:00
2020-12-19 11:18:38 -08:00
2020-12-16 12:10:40 -08:00
2020-11-05 07:44:15 -05:00
2020-10-25 20:02:08 -04:00
2020-12-30 19:36:54 -07:00
2020-04-10 15:36:22 -07:00
2020-08-23 17:36:59 -05:00
2020-10-13 18:38:27 -07:00
2020-07-29 16:14:27 +02:00
2021-01-13 17:26:21 +01:00
2020-08-23 17:36:59 -05:00
2020-08-04 21:02:38 -04:00
2020-12-25 10:54:29 -08:00
2020-12-16 12:57:51 -08:00
2021-01-27 09:18:28 -07:00
2020-12-20 10:47:42 -07:00
2020-12-20 10:47:42 -07:00
2020-07-31 08:16:01 +02:00
2020-08-07 11:33:24 -07:00
2020-06-14 01:57:21 +09:00
2020-10-05 13:37:04 +02:00
2020-12-17 11:18:00 -08:00
2020-12-15 19:29:43 -08:00
2020-10-23 11:33:41 -07:00
2020-08-19 14:14:19 +02:00
2020-06-02 10:59:07 -07:00
2020-12-25 10:54:29 -08:00
2021-01-04 15:31:58 -05:00
2020-05-13 11:41:22 +02:00
2020-12-15 19:29:43 -08:00
2020-12-01 14:53:39 -07:00
2020-04-27 10:37:14 -04:00
2020-12-10 17:33:17 -05:00
2020-06-08 11:04:19 -07:00
2020-12-27 12:00:36 -08:00
2020-10-23 11:33:41 -07:00
2020-07-31 08:16:00 +02:00
2020-12-14 15:26:13 +01:00
2021-01-08 11:06:29 -08:00
2020-11-15 22:12:53 -05:00
2020-08-23 17:36:59 -05:00
2020-10-24 12:40:18 -07:00
2020-09-26 22:55:05 -04:00
2020-12-01 14:53:39 -07:00
2020-12-01 14:53:39 -07:00
2020-06-09 15:40:50 -07:00
2020-12-15 12:13:46 -08:00
2020-07-31 08:16:01 +02:00
2020-12-14 15:26:13 +01:00