projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec3c3d0
)
io-wq: move nr_running and worker_refs out of wqe->lock protection
author
Hao Xu
<haoxu@linux.alibaba.com>
Tue, 10 Aug 2021 12:55:54 +0000
(20:55 +0800)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 23 Aug 2021 19:10:43 +0000
(13:10 -0600)
We don't need to protect nr_running and worker_refs by wqe->lock, so
narrow the range of raw_spin_lock_irq - raw_spin_unlock_irq
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Link:
https://lore.kernel.org/r/20210810125554.99229-1-haoxu@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/io-wq.c
b/fs/io-wq.c
index 4ce83bb480210986f5d507492284b62318603e56..8da9bb1039168ac3b15434492f926d31047b99bf 100644
(file)
--- a/
fs/io-wq.c
+++ b/
fs/io-wq.c
@@
-256,16
+256,17
@@
static void io_wqe_wake_worker(struct io_wqe *wqe, struct io_wqe_acct *acct)
raw_spin_lock_irq(&wqe->lock);
if (acct->nr_workers < acct->max_workers) {
- atomic_inc(&acct->nr_running);
- atomic_inc(&wqe->wq->worker_refs);
if (!acct->nr_workers)
first = true;
acct->nr_workers++;
do_create = true;
}
raw_spin_unlock_irq(&wqe->lock);
- if (do_create)
+ if (do_create) {
+ atomic_inc(&acct->nr_running);
+ atomic_inc(&wqe->wq->worker_refs);
create_io_worker(wqe->wq, wqe, acct->index, first);
+ }
}
}