block: switch to atomic_t for request references

refcount_t is not as expensive as it used to be, but it's still more
expensive than the io_uring method of using atomic_t and just checking
for potential over/underflow.

This borrows that same implementation, which in turn is based on the
mm implementation from Linus.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2021-10-14 14:39:59 -06:00
parent ceaa762527
commit 0a467d0fdd
5 changed files with 41 additions and 10 deletions

View File

@@ -139,7 +139,7 @@ struct request {
unsigned short ioprio;
enum mq_rq_state state;
refcount_t ref;
atomic_t ref;
unsigned long deadline;