From: Jens Axboe Date: Fri, 17 Apr 2015 22:23:59 +0000 (-0600) Subject: bio: skip atomic inc/dec of ->bi_cnt for most use cases X-Git-Tag: omap-for-v4.2/fixes-rc1^2~120^2~33 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dac56212e8127dbc0bff7be35c508bc280213309;p=pandora-kernel.git bio: skip atomic inc/dec of ->bi_cnt for most use cases Struct bio has a reference count that controls when it can be freed. Most uses cases is allocating the bio, which then returns with a single reference to it, doing IO, and then dropping that single reference. We can remove this atomic_dec_and_test() in the completion path, if nobody else is holding a reference to the bio. If someone does call bio_get() on the bio, then we flag the bio as now having valid count and that we must properly honor the reference count when it's being put. Tested-by: Robert Elliott Signed-off-by: Jens Axboe --- Reading git-diff-tree failed