File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -246,8 +246,6 @@ static bool io_wqe_activate_free_worker(struct io_wqe *wqe,
246
246
*/
247
247
static bool io_wqe_create_worker (struct io_wqe * wqe , struct io_wqe_acct * acct )
248
248
{
249
- bool do_create = false;
250
-
251
249
/*
252
250
* Most likely an attempt to queue unbounded work on an io_wq that
253
251
* wasn't setup with any unbounded workers.
@@ -256,18 +254,15 @@ static bool io_wqe_create_worker(struct io_wqe *wqe, struct io_wqe_acct *acct)
256
254
pr_warn_once ("io-wq is not configured for unbound workers" );
257
255
258
256
raw_spin_lock (& wqe -> lock );
259
- if (acct -> nr_workers < acct -> max_workers ) {
260
- acct -> nr_workers ++ ;
261
- do_create = true;
257
+ if (acct -> nr_workers == acct -> max_workers ) {
258
+ raw_spin_unlock ( & wqe -> lock ) ;
259
+ return true;
262
260
}
261
+ acct -> nr_workers ++ ;
263
262
raw_spin_unlock (& wqe -> lock );
264
- if (do_create ) {
265
- atomic_inc (& acct -> nr_running );
266
- atomic_inc (& wqe -> wq -> worker_refs );
267
- return create_io_worker (wqe -> wq , wqe , acct -> index );
268
- }
269
-
270
- return true;
263
+ atomic_inc (& acct -> nr_running );
264
+ atomic_inc (& wqe -> wq -> worker_refs );
265
+ return create_io_worker (wqe -> wq , wqe , acct -> index );
271
266
}
272
267
273
268
static void io_wqe_inc_running (struct io_worker * worker )
You can’t perform that action at this time.
0 commit comments