scsi: blk-mq: Return budget token from .get_budget callback
authorMing Lei <ming.lei@redhat.com>
Fri, 22 Jan 2021 02:33:12 +0000 (10:33 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 4 Mar 2021 22:36:59 +0000 (17:36 -0500)
commit2a5a24aa83382a88c43d18a901fab66e6ffe1199
tree85d9a1aa8d76bb25fe9fdc56f9a1b74f575ce485
parentd022d18c045fc2ccf92d0f14cf80f98eb0a8e119
scsi: blk-mq: Return budget token from .get_budget callback

SCSI uses a global atomic variable to track queue depth for each
LUN/request queue.

This doesn't scale well when there are lots of CPU cores and the disk is
very fast. It has been observed that IOPS is affected a lot by tracking
queue depth via sdev->device_busy in the I/O path.

Return budget token from .get_budget callback. The budget token can be
passed to driver so that we can replace the atomic variable with
sbitmap_queue and alleviate the scaling problems that way.

Link: https://lore.kernel.org/r/20210122023317.687987-9-ming.lei@redhat.com
Cc: Omar Sandoval <osandov@fb.com>
Cc: Kashyap Desai <kashyap.desai@broadcom.com>
Cc: Sumanesh Samanta <sumanesh.samanta@broadcom.com>
Cc: Ewan D. Milne <emilne@redhat.com>
Tested-by: Sumanesh Samanta <sumanesh.samanta@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
block/blk-mq-sched.c
block/blk-mq.c
block/blk-mq.h
drivers/scsi/scsi_lib.c
include/linux/blk-mq.h