On 1/27/22 07:37, Ming Lei wrote:
Martin reported that sdev->queue_depth can often be changed in ->slave_configure(), and now we uses ->cmd_per_lun as initial queue depth for setting up sdev->budget_map. And some extreme ->cmd_per_lun or ->can_queue won't be used at default actually, if they are used to allocate sdev->budget_map, huge memory may be consumed just because of bad ->cmd_per_lun. Fix the issue by reallocating sdev->budget_map after ->slave_configure() returns, at that time, queue_depth should be much more reasonable.
Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>