File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -149,6 +149,7 @@ static void io_clean_op(struct io_kiocb *req);
149
149
static void io_queue_sqe (struct io_kiocb * req );
150
150
static void io_move_task_work_from_local (struct io_ring_ctx * ctx );
151
151
static void __io_submit_flush_completions (struct io_ring_ctx * ctx );
152
+ static __cold void io_fallback_tw (struct io_uring_task * tctx );
152
153
153
154
static struct kmem_cache * req_cachep ;
154
155
@@ -1149,10 +1150,17 @@ void tctx_task_work(struct callback_head *cb)
1149
1150
struct io_uring_task * tctx = container_of (cb , struct io_uring_task ,
1150
1151
task_work );
1151
1152
struct llist_node fake = {};
1152
- struct llist_node * node = io_llist_xchg ( & tctx -> task_list , & fake ) ;
1153
+ struct llist_node * node ;
1153
1154
unsigned int loops = 1 ;
1154
- unsigned int count = handle_tw_list (node , & ctx , & uring_locked , NULL );
1155
+ unsigned int count ;
1156
+
1157
+ if (unlikely (current -> flags & PF_EXITING )) {
1158
+ io_fallback_tw (tctx );
1159
+ return ;
1160
+ }
1155
1161
1162
+ node = io_llist_xchg (& tctx -> task_list , & fake );
1163
+ count = handle_tw_list (node , & ctx , & uring_locked , NULL );
1156
1164
node = io_llist_cmpxchg (& tctx -> task_list , & fake , NULL );
1157
1165
while (node != & fake ) {
1158
1166
loops ++ ;
You can’t perform that action at this time.
0 commit comments