@@ -2350,22 +2350,10 @@ static bool current_pending_io(void)
2350
2350
return percpu_counter_read_positive (& tctx -> inflight );
2351
2351
}
2352
2352
2353
- /* when returns >0, the caller should retry */
2354
- static inline int io_cqring_wait_schedule (struct io_ring_ctx * ctx ,
2355
- struct io_wait_queue * iowq )
2353
+ static int __io_cqring_wait_schedule (struct io_ring_ctx * ctx ,
2354
+ struct io_wait_queue * iowq )
2356
2355
{
2357
- int ret ;
2358
-
2359
- if (unlikely (READ_ONCE (ctx -> check_cq )))
2360
- return 1 ;
2361
- if (unlikely (!llist_empty (& ctx -> work_llist )))
2362
- return 1 ;
2363
- if (unlikely (test_thread_flag (TIF_NOTIFY_SIGNAL )))
2364
- return 1 ;
2365
- if (unlikely (task_sigpending (current )))
2366
- return - EINTR ;
2367
- if (unlikely (io_should_wake (iowq )))
2368
- return 0 ;
2356
+ int ret = 0 ;
2369
2357
2370
2358
/*
2371
2359
* Mark us as being in io_wait if we have pending requests, so cpufreq
@@ -2374,7 +2362,6 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
2374
2362
*/
2375
2363
if (current_pending_io ())
2376
2364
current -> in_iowait = 1 ;
2377
- ret = 0 ;
2378
2365
if (iowq -> timeout == KTIME_MAX )
2379
2366
schedule ();
2380
2367
else if (!schedule_hrtimeout_range_clock (& iowq -> timeout , 0 ,
@@ -2384,6 +2371,24 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
2384
2371
return ret ;
2385
2372
}
2386
2373
2374
+ /* If this returns > 0, the caller should retry */
2375
+ static inline int io_cqring_wait_schedule (struct io_ring_ctx * ctx ,
2376
+ struct io_wait_queue * iowq )
2377
+ {
2378
+ if (unlikely (READ_ONCE (ctx -> check_cq )))
2379
+ return 1 ;
2380
+ if (unlikely (!llist_empty (& ctx -> work_llist )))
2381
+ return 1 ;
2382
+ if (unlikely (test_thread_flag (TIF_NOTIFY_SIGNAL )))
2383
+ return 1 ;
2384
+ if (unlikely (task_sigpending (current )))
2385
+ return - EINTR ;
2386
+ if (unlikely (io_should_wake (iowq )))
2387
+ return 0 ;
2388
+
2389
+ return __io_cqring_wait_schedule (ctx , iowq );
2390
+ }
2391
+
2387
2392
struct ext_arg {
2388
2393
size_t argsz ;
2389
2394
struct __kernel_timespec __user * ts ;
0 commit comments