On 6/26/24 6:18 AM, Ziqi Chen wrote:
On 6/26/2024 12:13 AM, Bart Van Assche wrote:
ufshcd_wait_for_doorbell_clr() should be removed and
ufshcd_clock_scaling_prepare() should use blk_mq_freeze_*().
See also my patch "ufs: Simplify the clock scaling mechanism
implementation" from 5 years ago
(https://lore.kernel.org/linux-scsi/20191112173743.141503-5-bvanassche@xxxxxxx/).
The defect of blk_mq_freeze_*() is that it would bring in significant
latency and performance regression. I don't think it is what many people
want to see.
This can be solved by inserting a synchronize_srcu_expedited() call
between the blk_freeze_queue_start() and the
blk_mq_freeze_queue_wait_timeout() calls. With that call added, the
latency of the new code should be lower than that of the
io_schedule_timeout(msecs_to_jiffies(20)) call in the current code.
blk_mq_freeze_*() is only slow if the RCU grace period is not expedited.
Bart.