Allocation hint should have belonged to sbitmap. Also, when sbitmap's depth
is high and there is no need to use mulitple wakeup queues, user can
benefit from percpu allocation hint too.
Move allocation hint into sbitmap, then SCSI device queue can benefit from
allocation hint when converting to plain sbitmap.
Convert vhost/scsi.c to use sbitmap allocation with percpu alloc hint. This
is more efficient than the previous approach.
BugLink: https://launchpad.net/bugs/1935034
Link: https://<email address hidden>
Cc: Omar Sandoval <email address hidden>
Cc: Kashyap Desai <email address hidden>
Cc: Sumanesh Samanta <email address hidden>
Cc: Ewan D. Milne <email address hidden>
Cc: Mike Christie <email address hidden>
Cc: <email address hidden>
Tested-by: Sumanesh Samanta <email address hidden>
Reviewed-by: Hannes Reinecke <email address hidden>
Signed-off-by: Ming Lei <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit c548e62bcf6adc7066ff201e9ecc88e536dd8890)
Signed-off-by: Michael Reed <email address hidden>
scsi: sbitmap: Add helpers for updating allocation hint
Add helpers for updating allocation hint so that we can avoid duplicate
code.
Prepare for moving allocation hint into sbitmap.
BugLink: https://launchpad.net/bugs/1935034
Link: https://<email address hidden>
Cc: Omar Sandoval <email address hidden>
Cc: Kashyap Desai <email address hidden>
Cc: Sumanesh Samanta <email address hidden>
Cc: Ewan D. Milne <email address hidden>
Cc: Hannes Reinecke <email address hidden>
Tested-by: Sumanesh Samanta <email address hidden>
Reviewed-by: Hannes Reinecke <email address hidden>
Signed-off-by: Ming Lei <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit bf2c4282a10a92810ba83e85677a5273d6ca0df5)
Signed-off-by: Michael Reed <email address hidden>
1cde9ae...
by
Kashyap Desai <email address hidden>
scsi: megaraid_sas: Replace sdev_busy with local counter
Use local tracking of per-sdev outstanding command since sdev_busy in SCSI
mid layer is improved for performance reason using sbitmap (earlier it was
atomic variable).
BugLink: https://launchpad.net/bugs/1935034
Link: https://<email address hidden>
Cc: Omar Sandoval <email address hidden>
Cc: Kashyap Desai <email address hidden>
Cc: Sumanesh Samanta <email address hidden>
Cc: Ewan D. Milne <email address hidden>
Reviewed-by: Hannes Reinecke <email address hidden>
Signed-off-by: Kashyap Desai <email address hidden>
Signed-off-by: Ming Lei <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit 6cb9b15238a389a8892a6ed08f5c68a0ac45d720)
Signed-off-by: Michael Reed <email address hidden>
SCSI's .device_busy will be converted to sbitmap and sbitmap_weight is
needed. Export the helper.
The only existing user of sbitmap_weight() uses it to find out how many
bits are set and not cleared. Align sbitmap_weight() meaning with this
usage model.
BugLink: https://launchpad.net/bugs/1935034
Link: https://<email address hidden>
Cc: Omar Sandoval <email address hidden>
Cc: Kashyap Desai <email address hidden>
Cc: Sumanesh Samanta <email address hidden>
Cc: Ewan D. Milne <email address hidden>
Tested-by: Sumanesh Samanta <email address hidden>
Reviewed-by: Hannes Reinecke <email address hidden>
Signed-off-by: Ming Lei <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit cbb9950b41dd9dfb7c2be3429ba09f83b8b1ff98)
Signed-off-by: Michael Reed <email address hidden>
scsi: core: Replace sdev->device_busy with sbitmap
SCSI currently uses an atomic variable to track queue depth for each
attached device. The queue depth depends on many factors such as transport
type and device implementation. In addition, the SCSI device queue depth is
not a static entity but changes over time as a result of congestion
management.
While blk-mq currently tracks queue depth for each hctx, it can't easily be
changed to accommodate the SCSI per-device requirement.
The current approach of using an atomic variable doesn't scale well when
there are lots of CPU cores and the disk is very fast. IOPS can be
substantially impacted by the atomic in the hot path.
Replace the atomic variable sdev->device_busy with an sbitmap for tracking
the SCSI device queue depth.
It has been observed that IOPS is improved ~30% by this patchset in the
following test:
1) test machine(32 logical CPU cores)
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node(s): 2
Model name: Intel(R) Xeon(R) Silver 4110 CPU @ 2.10GHz
Fix the structurally dead code (UNREACHABLE) type of error reported by
Coverity.
BugLink: https://launchpad.net/bugs/1935034
Link: https://lore<email address hidden>
Reported-by: Colin Ian King <email address hidden>
Signed-off-by: Suganath Prabu S <email address hidden>
Signed-off-by: Martin K. Petersen <email address hidden>
(cherry picked from commit cf750be8e68e8c2755f0ee29784463a2da91e922)
Signed-off-by: Michael Reed <email address hidden>
b32e8af...
by
"Gustavo A. R. Silva" <email address hidden>
scsi: mpt3sas: Fix fall-through warnings for Clang
In preparation to enable -Wimplicit-fallthrough for Clang, fix a couple
of warnings by explicitly adding break statements instead of just letting
the code fall through to the next case.