All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Yu Kuai <yukuai1@huaweicloud.com>, Christoph Hellwig <hch@infradead.org>
Cc: Ed Tsai <ed.tsai@mediatek.com>,
	axboe@kernel.dk, linux-block@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	martin.petersen@oracle.com, stanley.chu@mediatek.com,
	peter.wang@mediatek.com, chun-hung.wu@mediatek.com,
	alice.chao@mediatek.com, powen.kao@mediatek.com,
	naomi.chu@mediatek.com, wsd_upstream@mediatek.com,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH 2/2] ufs: don't use the fair tag sharings
Date: Tue, 16 May 2023 08:12:19 -0700	[thread overview]
Message-ID: <86065501-ab2e-09b4-71cd-c0b18ede00ed@acm.org> (raw)
In-Reply-To: <de3f41a0-b13d-d4f6-765a-19b857bce53e@huaweicloud.com>

On 5/12/23 20:09, Yu Kuai wrote:
> 在 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?

I'm afraid that this approach won't help for the UFS driver since it is 
likely that all tags are in use by a single logical unit during an IOPS 
test. Hence, fair sharing would be enabled even when we don't want it to 
be enabled.

I propose that we switch to one of these two approaches:
* Either remove the fair tag sharing code entirely and rely on the 
fairness mechanism provided by the sbitmap code. I'm referring to how 
__sbitmap_queue_wake_up() uses the wake_index member variable.
* Or make the behavior of the fairness algorithm configurable from user 
space. One possible approach is to make the proportion of tags for a 
logical unit / NVMe namespace configurable via sysfs. This will allow to 
reduce the number of tags for the WLUN of UFS devices.

Thanks,

Bart.


  reply	other threads:[~2023-05-16 15:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-09  6:52 [PATCH 0/2] block: improve the share tag set performance Ed Tsai
2023-05-09  6:52 ` [PATCH 1/2] block: make the fair sharing of tag configurable Ed Tsai
2023-05-09 21:33   ` kernel test robot
2023-05-11 15:33   ` Christoph Hellwig
2023-05-22  5:30   ` kernel test robot
2023-05-09  6:52 ` [PATCH 2/2] ufs: don't use the fair tag sharings Ed Tsai
2023-05-09  8:03   ` Avri Altman
2023-05-09 14:04     ` Bart Van Assche
2023-05-09 16:19       ` Avri Altman
2023-05-09 16:30         ` Bart Van Assche
2023-05-10  5:21           ` Avri Altman
2023-05-10 15:56             ` Bart Van Assche
2023-05-11 15:34   ` Christoph Hellwig
2023-05-11 15:38     ` Bart Van Assche
2023-05-12 14:02       ` Christoph Hellwig
2023-05-12 18:12         ` Bart Van Assche
2023-05-13  3:09           ` Yu Kuai
2023-05-16 15:12             ` Bart Van Assche [this message]
2023-05-17  7:49               ` Yu Kuai
2023-05-17 18:23                 ` Bart Van Assche
2023-05-18  1:49                   ` Yu Kuai
2023-05-18  2:23                     ` Bart Van Assche
2023-05-18  7:55                       ` Yu Kuai
2023-06-13 14:07                         ` Bart Van Assche
2023-06-14  1:58                           ` Yu Kuai
2023-05-10 22:56 ` [PATCH 0/2] block: improve the share tag set performance Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86065501-ab2e-09b4-71cd-c0b18ede00ed@acm.org \
    --to=bvanassche@acm.org \
    --cc=alice.chao@mediatek.com \
    --cc=axboe@kernel.dk \
    --cc=chun-hung.wu@mediatek.com \
    --cc=ed.tsai@mediatek.com \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=naomi.chu@mediatek.com \
    --cc=peter.wang@mediatek.com \
    --cc=powen.kao@mediatek.com \
    --cc=stanley.chu@mediatek.com \
    --cc=wsd_upstream@mediatek.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.