On 1/30/24 22:22, Christoph Hellwig wrote:
On Mon, Jan 29, 2024 at 04:03:11PM -0800, Bart Van Assche wrote:
Would you agree with disabling fair sharing entirely?
As far as I can tell fair sharing exists to for two reasons:
1) to guarantee each queue can actually make progress for e.g.
memory reclaim
2) to not unfairly give queues and advantage over others
What are you arguments that we do not need this?
Regarding (1), isn't forward progress guaranteed by the sbitmap
implementation? The algorithm in __sbitmap_queue_wake_up() does not guarantee
perfect fairness but I think it is good enough to guarantee forward progress
of code that is waiting for a block layer tag.
Regarding (2), the fairness algorithm in the blk-mq code was introduced
before fairness of the sbitmap implementation was improved. See also commit
0d2602ca30e4 ("blk-mq: improve support for shared tags maps") from 2014 and
commit 976570b4ecd3 ("sbitmap: Advance the queue index before waking up a
queue") from 2022. The current code in the sbitmap implementation is
probably good enough if request queues share a tag set. It would be
interesting to verify this with two null_blk driver instances with
shared_tags and different completion_nsec values.
Thanks,
Bart.