File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ static bool io_wqe_create_worker(struct io_wqe *wqe, struct io_wqe_acct *acct)
253
253
pr_warn_once ("io-wq is not configured for unbound workers" );
254
254
255
255
raw_spin_lock (& wqe -> lock );
256
- if (acct -> nr_workers = = acct -> max_workers ) {
256
+ if (acct -> nr_workers > = acct -> max_workers ) {
257
257
raw_spin_unlock (& wqe -> lock );
258
258
return true;
259
259
}
@@ -1291,15 +1291,18 @@ int io_wq_max_workers(struct io_wq *wq, int *new_count)
1291
1291
1292
1292
rcu_read_lock ();
1293
1293
for_each_node (node ) {
1294
+ struct io_wqe * wqe = wq -> wqes [node ];
1294
1295
struct io_wqe_acct * acct ;
1295
1296
1297
+ raw_spin_lock (& wqe -> lock );
1296
1298
for (i = 0 ; i < IO_WQ_ACCT_NR ; i ++ ) {
1297
- acct = & wq -> wqes [ node ] -> acct [i ];
1299
+ acct = & wqe -> acct [i ];
1298
1300
prev = max_t (int , acct -> max_workers , prev );
1299
1301
if (new_count [i ])
1300
1302
acct -> max_workers = new_count [i ];
1301
1303
new_count [i ] = prev ;
1302
1304
}
1305
+ raw_spin_unlock (& wqe -> lock );
1303
1306
}
1304
1307
rcu_read_unlock ();
1305
1308
return 0 ;
You can’t perform that action at this time.
0 commit comments