]> git.ipfire.org Git - thirdparty/linux.git/commit - include/linux/blkdev.h
blk-mq: Remove generation seqeunce
authorKeith Busch <keith.busch@intel.com>
Tue, 29 May 2018 13:52:28 +0000 (15:52 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 May 2018 14:59:21 +0000 (08:59 -0600)
commit12f5b93145450c750f315657ef239a314811aeeb
tree81c7c9f0dfc660a1c78a4404f6d5c3f99e44169b
parentad103e79838d4b4cd4d6dd0bdfaef937e8652ae9
blk-mq: Remove generation seqeunce

This patch simplifies the timeout handling by relying on the request
reference counting to ensure the iterator is operating on an inflight
and truly timed out request. Since the reference counting prevents the
tag from being reallocated, the block layer no longer needs to prevent
drivers from completing their requests while the timeout handler is
operating on it: a driver completing a request is allowed to proceed to
the next state without additional syncronization with the block layer.

This also removes any need for generation sequence numbers since the
request lifetime is prevented from being reallocated as a new sequence
while timeout handling is operating on it.

To enables this a refcount is added to struct request so that request
users can be sure they're operating on the same request without it
changing while they're processing it.  The request's tag won't be
released for reuse until both the timeout handler and the completion
are done with it.

Signed-off-by: Keith Busch <keith.busch@intel.com>
[hch: slight cleanups, added back submission side hctx lock, use cmpxchg
 for completions]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c
block/blk-mq-debugfs.c
block/blk-mq.c
block/blk-mq.h
block/blk-timeout.c
include/linux/blkdev.h