From: Shawn Lin <shawn.lin@rock-chips.com>
To: "Sharp Xia (夏宇彬)" <Sharp.Xia@mediatek.com>,
"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>
Cc: shawn.lin@rock-chips.com,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
wsd_upstream <wsd_upstream@mediatek.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"angelogioacchino.delregno@collabora.com"
<angelogioacchino.delregno@collabora.com>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Subject: Re: [PATCH 1/1] mmc: Set optimal I/O size when mmc_setip_queue
Date: Fri, 25 Aug 2023 16:11:49 +0800 [thread overview]
Message-ID: <c8c059ce-53a9-3627-8984-dff771dff1de@rock-chips.com> (raw)
In-Reply-To: <f71672cc699900b57d257c56b325e185f2b6fdd9.camel@mediatek.com>
Hi Sharp,
On 2023/8/25 15:10, Sharp Xia (夏宇彬) wrote:
> On Thu, 2023-08-24 at 12:55 +0200, Ulf Hansson wrote:
>>
>> External email : Please do not click links or open attachments until
>> you have verified the sender or the content.
>> On Fri, 18 Aug 2023 at 04:45, <Sharp.Xia@mediatek.com> wrote:
>>>
>>> From: Sharp Xia <Sharp.Xia@mediatek.com>
>>>
>>> MMC does not set readahead and uses the default VM_READAHEAD_PAGES
>>> resulting in slower reading speed.
>>> Use the max_req_size reported by host driver to set the optimal
>>> I/O size to improve performance.
>>
>> This seems reasonable to me. However, it would be nice if you could
>> share some performance numbers too - comparing before and after
>> $subject patch.
>>
>> Kind regards
>> Uffe
>>
>>>
>>> Signed-off-by: Sharp Xia <Sharp.Xia@mediatek.com>
>>> ---
>>> drivers/mmc/core/queue.c | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
>>> index b396e3900717..fc83c4917360 100644
>>> --- a/drivers/mmc/core/queue.c
>>> +++ b/drivers/mmc/core/queue.c
>>> @@ -359,6 +359,7 @@ static void mmc_setup_queue(struct mmc_queue
>> *mq, struct mmc_card *card)
>>> blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_HIGH);
>>> blk_queue_max_hw_sectors(mq->queue,
>>> min(host->max_blk_count, host->max_req_size /
>> 512));
>>> + blk_queue_io_opt(mq->queue, host->max_req_size);
>>> if (host->can_dma_map_merge)
>>> WARN(!blk_queue_can_use_dma_map_merging(mq->queue,
>>> mmc_dev(hos
>> t)),
>>> --
>>> 2.18.0
>>>
>
> I test this patch on internal platform(kernel-5.15).
I patched this one and the test shows me a stable 11% performance drop.
Before:
echo 3 > proc/sys/vm/drop_caches && dd if=/data/1GB.img of=/dev/null
2048000+0 records in
2048000+0 records out
1048576000 bytes (0.9 G) copied, 3.912249 s, 256 M/s
After:
echo 3 > proc/sys/vm/drop_caches && dd if=/data/1GB.img of=/dev/null
2048000+0 records in
2048000+0 records out
1048576000 bytes (0.9 G) copied, 4.436271 s, 225 M/s
>
> Before:
> console:/ # echo 3 > /proc/sys/vm/drop_caches
> console:/ # dd if=/mnt/media_rw/8031-130D/super.img of=/dev/null
> 4485393+1 records in
> 4485393+1 records out
> 2296521564 bytes (2.1 G) copied, 37.124446 s, 59 M/s
> console:/ # cat /sys/block/mmcblk0/queue/read_ahead_kb
> 128
>
> After:
> console:/ # echo 3 > /proc/sys/vm/drop_caches
> console:/ # dd if=/mnt/media_rw/8031-130D/super.img of=/dev/null
> 4485393+1 records in
> 4485393+1 records out
> 2296521564 bytes (2.1 G) copied, 28.956049 s, 76 M/s
> console:/ # cat /sys/block/mmcblk0/queue/read_ahead_kb
> 1024
>
next prev parent reply other threads:[~2023-08-25 8:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 2:28 [PATCH 1/1] mmc: Set optimal I/O size when mmc_setip_queue Sharp.Xia
2023-08-24 10:55 ` Ulf Hansson
2023-08-25 7:10 ` Sharp Xia (夏宇彬)
2023-08-25 8:11 ` Shawn Lin [this message]
2023-08-25 8:39 ` Sharp.Xia
2023-08-25 9:17 ` Shawn Lin
2023-08-26 16:26 ` Sharp.Xia
2023-08-28 2:27 ` Shawn Lin
2023-08-28 9:04 ` Ulf Hansson
2023-08-25 12:23 ` Wenchao Chen
2023-08-26 16:54 ` Sharp.Xia
2023-08-25 7:25 ` Sharp.Xia
2023-08-25 7:26 ` Sharp.Xia
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=c8c059ce-53a9-3627-8984-dff771dff1de@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=Sharp.Xia@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=wsd_upstream@mediatek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox