Re: [PATCH 2/2] ufs: don't use the fair tag sharings

From: Yu Kuai
Date: Fri May 12 2023 - 23:10:57 EST


Hi,

在 2023/05/13 2:12, Bart Van Assche 写道:
The fair tag sharing algorithm has a negative impact on all SCSI devices with multiple logical units. This is because logical units are considered active until (request timeout) seconds have elapsed after the logical unit stopped being used (see also the blk_mq_tag_idle() call in blk_mq_timeout_work()). UFS users are hit by this because UFS 3.0 devices have a limited queue depth (32) and because power management commands are submitted to a logical unit (WLUN). Hence, it happens often that the block layer "active queue" counter is equal to 2 while only one logical unit is being used actively (a logical unit backed by NAND flash). The performance difference between queue depths 16 and 32 for UFS devices is significant.

We meet similiar problem before, but I think remove tag fair sharing
might cause some problems, because get tag is not fair currently, for
example 2 devices share 32 tag, while device a issue large amount of
io concurrently, and device b only issue one io, in this case, if fair
tag sharing is removed, device b can get bad io latency.

By the way, I tried to propose a way to workaround this by following:

1) disable fair tag sharing untill get tag found no tag is avaiable;
2) enable fair tag sharing again if the disk donesn't faild to get tag
for a period of time;

Can this approch be considered?

Thanks,
Kuai