]> git.baikalelectronics.ru Git - kernel.git/commit
block: optimise bvec_iter_advance()
authorPavel Begunkov <asml.silence@gmail.com>
Sat, 30 Nov 2019 20:23:52 +0000 (23:23 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Dec 2019 14:36:38 +0000 (07:36 -0700)
commit3a342f2206f55f8d5bb0c6d6c07c644c3232a94f
tree37a0074d7559534cd68eb5d58883f5ab27f3bf7d
parenta05a5c00f5398fa4307c465d68014498bd1bd268
block: optimise bvec_iter_advance()

bvec_iter_advance() is quite popular, but compilers fail to do proper
alias analysis and optimise it good enough. The assembly is checked
for gcc 9.2, x86-64.

- remove @iter->bi_size from min(...), as it's always less than @bytes.
Modify at the beginning and forget about it.

- the compiler isn't able to collapse memory dependencies and remove
writes in the loop. Help it by explicitely using local vars.

Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/bvec.h