Bart Van Assche wrote:
> How about sharing tag sets across hardware
> queues, e.g. like in the (totally untested) patch below?
So this is similar in principle what Ming Lei came up with here:
https://lore.kernel.org/linux-block/20190531022801.10003-1-ming.lei@xxxxxxxxxx/
However your implementation looks neater, which is good.
My concern with this approach is that we can't differentiate which tags are allocated for which hctx, and sometimes we need to know that.
An example here was blk_mq_queue_tag_busy_iter(), which iterates the bits for each hctx. This would just be broken by that change, unless we record which bits are associated with each hctx.
Another example was __blk_mq_tag_idle(), which looks problematic.
For debugfs, when we examine /sys/kernel/debug/block/.../hctxX/tags_bitmap, wouldn't that be the tags for all hctx (hctx0)?
For debugging reasons, I would say we want to know which tags are allocated for a specific hctx, as this is tightly related to the requests for that hctx.
@@ -341,8 +341,11 @@ void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
ÂÂÂÂÂ int i;
ÂÂÂÂÂ for (i = 0; i < tagset->nr_hw_queues; i++) {
-ÂÂÂÂÂÂÂ if (tagset->tags && tagset->tags[i])
+ÂÂÂÂÂÂÂ if (tagset->tags && tagset->tags[i]) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂ blk_mq_all_tag_busy_iter(tagset->tags[i], fn, priv);
As I mentioned earlier, wouldn't this iterate over all tags for all hctx's, when we just want the tags for hctx[i]?
Thanks,
John
[Not trimming reply for future reference]
+ÂÂÂÂÂÂÂÂÂÂÂ if (tagset->share_tags)
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ break;
+ÂÂÂÂÂÂÂ }
ÂÂÂÂÂ }
 }
 EXPORT_SYMBOL(blk_mq_tagset_busy_iter);