summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2022-01-27 23:37:33 +0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-01-31 12:56:01 -0500
commitedb854a3680bacc9ef9b91ec0c5ff6105886f6f3 (patch)
tree55c214c1b42bbe7105e4a15bbe6bd6ac76844edd /include
parent936bd03405fc83ba039d42bc93ffd4b88418f1d3 (diff)
downloadlinux-stable-edb854a3680bacc9ef9b91ec0c5ff6105886f6f3.tar.gz
linux-stable-edb854a3680bacc9ef9b91ec0c5ff6105886f6f3.tar.bz2
linux-stable-edb854a3680bacc9ef9b91ec0c5ff6105886f6f3.zip
scsi: core: Reallocate device's budget map on queue depth change
We currently use ->cmd_per_lun as initial queue depth for setting up the budget_map. Martin Wilck reported that it is common for the queue_depth to be subsequently updated in slave_configure() based on detected hardware characteristics. As a result, for some drivers, the static host template settings for cmd_per_lun and can_queue won't actually get used in practice. And if the default values are used to allocate the budget_map, memory may be consumed unnecessarily. Fix the issue by reallocating the budget_map after ->slave_configure() returns. At that time the device queue_depth should accurately reflect what the hardware needs. Link: https://lore.kernel.org/r/20220127153733.409132-1-ming.lei@redhat.com Cc: Bart Van Assche <bvanassche@acm.org> Reported-by: Martin Wilck <martin.wilck@suse.com> Suggested-by: Martin Wilck <martin.wilck@suse.com> Tested-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions