aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2019-12-30 03:13:38 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-12-30 03:13:38 +0000
commit024932aae96e5e4fe5d39827e4b4abdc4f1adc95 (patch)
tree51a0a67ac8f2be8d31d2d7c398b40727dd089549 /sys/cam/ctl
parent9367fb301c79b759b0d9f18ef5b34e6455619724 (diff)
downloadsrc-024932aae96e5e4fe5d39827e4b4abdc4f1adc95.tar.gz
src-024932aae96e5e4fe5d39827e4b4abdc4f1adc95.zip
Use atomic for start_count in devstat_start_transaction().
Combined with earlier nstart/nend removal it allows to remove several locks from request path of GEOM and few other places. It would be cool if we had more SMP-friendly statistics, but this helps too. Sponsored by: iXsystems, Inc.
Notes
Notes: svn path=/head/; revision=356200
Diffstat (limited to 'sys/cam/ctl')
-rw-r--r--sys/cam/ctl/ctl_backend_block.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c
index eeddf1735bce..ae3a322c394e 100644
--- a/sys/cam/ctl/ctl_backend_block.c
+++ b/sys/cam/ctl/ctl_backend_block.c
@@ -580,9 +580,7 @@ ctl_be_block_flush_file(struct ctl_be_block_lun *be_lun,
DPRINTF("entered\n");
binuptime(&beio->ds_t0);
- mtx_lock(&be_lun->io_lock);
devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
- mtx_unlock(&be_lun->io_lock);
(void) vn_start_write(be_lun->vn, &mountpoint, V_WAIT);
@@ -663,9 +661,7 @@ ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun,
}
binuptime(&beio->ds_t0);
- mtx_lock(&be_lun->io_lock);
devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
- mtx_unlock(&be_lun->io_lock);
if (beio->bio_cmd == BIO_READ) {
vn_lock(be_lun->vn, LK_SHARED | LK_RETRY);
@@ -894,9 +890,7 @@ ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun,
}
binuptime(&beio->ds_t0);
- mtx_lock(&be_lun->io_lock);
devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0);
- mtx_unlock(&be_lun->io_lock);
csw = devvn_refthread(be_lun->vn, &dev, &ref);
if (csw) {
@@ -1034,9 +1028,7 @@ ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun,
beio->send_complete = 1;
binuptime(&beio->ds_t0);
- mtx_lock(&be_lun->io_lock);
devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0);
- mtx_unlock(&be_lun->io_lock);
csw = devvn_refthread(be_lun->vn, &dev, &ref);
if (csw) {
@@ -1107,9 +1099,7 @@ ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun,
DPRINTF("entered\n");
binuptime(&beio->ds_t0);
- mtx_lock(&be_lun->io_lock);
devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0);
- mtx_unlock(&be_lun->io_lock);
if (beio->io_offset == -1) {
beio->io_len = 0;
@@ -1186,11 +1176,9 @@ ctl_be_block_dispatch_dev(struct ctl_be_block_lun *be_lun,
beio->num_bios_sent++;
}
}
+ beio->send_complete = 1;
binuptime(&beio->ds_t0);
- mtx_lock(&be_lun->io_lock);
devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0);
- beio->send_complete = 1;
- mtx_unlock(&be_lun->io_lock);
/*
* Fire off all allocated requests!