diff options
author | Jens Axboe <axboe@fb.com> | 2015-04-17 22:15:18 (GMT) |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-05-05 19:32:47 (GMT) |
commit | c4cf5261f8bffd9de132b50660a69148e7575bd6 (patch) | |
tree | c3ff2d0d2db5f7392e8651b4f0d2958895faf8b2 /drivers/md/dm-raid1.c | |
parent | d9cee5d4f66ef36f69b0108dedbad7f7009bb6a8 (diff) | |
download | linux-c4cf5261f8bffd9de132b50660a69148e7575bd6.tar.xz |
bio: skip atomic inc/dec of ->bi_remaining for non-chains
Struct bio has an atomic ref count for chained bio's, and we use this
to know when to end IO on the bio. However, most bio's are not chained,
so we don't need to always introduce this atomic operation as part of
ending IO.
Add a helper to elevate the bi_remaining count, and flag the bio as
now actually needing the decrement at end_io time. Rename the field
to __bi_remaining to catch any current users of this doing the
incrementing manually.
For high IOPS workloads, this reduces the overhead of bio_endio()
substantially.
Tested-by: Robert Elliott <elliott@hp.com>
Acked-by: Kent Overstreet <kent.overstreet@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/md/dm-raid1.c')
-rw-r--r-- | drivers/md/dm-raid1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 089d627..d6a1c09 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c @@ -1254,7 +1254,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error) dm_bio_restore(bd, bio); bio_record->details.bi_bdev = NULL; - atomic_inc(&bio->bi_remaining); + bio_inc_remaining(bio); queue_bio(ms, bio, rw); return DM_ENDIO_INCOMPLETE; |