]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bio: skip atomic inc/dec of ->bi_remaining for non-chains
authorJens Axboe <axboe@fb.com>
Fri, 17 Apr 2015 22:15:18 +0000 (16:15 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 14:47:31 +0000 (06:47 -0800)
commit00f40ad268eeed38de946e8716b1675e60ab575d
tree8e3d98262ec99a7930af98c12e1e3bdd337aa491
parentf6edca4c01af7971cd791f6802b2fa11fcb451b3
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>
(cherry picked from commit c4cf5261f8bffd9de132b50660a69148e7575bd6)

Orabug: 22820562
Signed-off-by: Jason Luo <zhangqing.luo@oracle.com>
block/bio.c
drivers/md/dm-cache-target.c
drivers/md/dm-raid1.c
drivers/md/dm-snap.c
drivers/md/dm-thin.c
include/linux/bio.h
include/linux/blk_types.h