From: "Arnd Bergmann" <arnd@arndb.de>
To: "Sam Protsenko" <semen.protsenko@linaro.org>
Cc: "jh80.chung" <jh80.chung@samsung.com>,
"Ulf Hansson" <ulf.hansson@linaro.org>,
"Christoph Hellwig" <hch@lst.de>, "Chris Ball" <cjb@laptop.org>,
"Will Newton" <will.newton@gmail.com>,
"Matt Fleming" <matt@console-pimps.org>,
"Christian Brauner" <brauner@kernel.org>,
"Jens Axboe" <axboe@kernel.dk>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Dan Carpenter" <dan.carpenter@linaro.org>,
"Anders Roxell" <anders.roxell@linaro.org>,
"Naresh Kamboju" <naresh.kamboju@linaro.org>,
"linux-mmc @ vger . kernel . org" <linux-mmc@vger.kernel.org>,
linux-block <linux-block@vger.kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K
Date: Tue, 27 Aug 2024 09:27:34 +0200 [thread overview]
Message-ID: <bd334314-25f7-4e87-bcab-e3baed9a7ab5@app.fastmail.com> (raw)
In-Reply-To: <CAPLW+4=NcjOFRd14ecYd8sMsiJXH9c+ZXse7BVMCWe5ZbMmKMQ@mail.gmail.com>
On Tue, Aug 27, 2024, at 03:28, Sam Protsenko wrote:
> On Thu, Mar 7, 2024 at 1:52 AM Arnd Bergmann <arnd@arndb.de> wrote:
>>
>> The change looks good to me.
>>
>> I see that the host->ring_size depends on PAGE_SIZE as well:
>>
>> #define DESC_RING_BUF_SZ PAGE_SIZE
>> host->ring_size = DESC_RING_BUF_SZ / sizeof(struct idmac_desc_64addr);
>> host->sg_cpu = dmam_alloc_coherent(host->dev,
>> DESC_RING_BUF_SZ, &host->sg_dma, GFP_KERNEL);
>>
>> I don't see any reason for the ring buffer size to be tied to
>> PAGE_SIZE at all, it was probably picked as a reasonable
>> default in the initial driver but isn't necessarily ideal.
>>
>> From what I can see, the number of 4KB elements in the
>> ring can be as small as 128 (4KB pages, 64-bit addresses)
>> or as big as 4096 (64KB pages, 32-bit addresses), which is
>> quite a difference. If you are still motivated to drill
>> down into this, could you try changing DESC_RING_BUF_SZ
>> to a fixed size of either 4KB or 64KB and test again
>> with the opposite page size, to see if that changes the
>> throughput?
>>
>
> Sorry for the huge delay. Just ran the tests:
>
> - 4K pages, DESC_RING_BUF_SZ = 4K: 97 MB/s
> - 4K pages, DESC_RING_BUF_SZ = 16K: 98 MB/s
> - 4K pages, DESC_RING_BUF_SZ = 64K: 97 MB/s
> - 16K pages, DESC_RING_BUF_SZ = 4K: 123 MB/s
> - 16K pages, DESC_RING_BUF_SZ = 16K: 125 MB/s
> - 16K pages, DESC_RING_BUF_SZ = 64K: 124 MB/s
> - 64K pages, DESC_RING_BUF_SZ = 4K: 137 MB/s
> - 64K pages, DESC_RING_BUF_SZ = 16K: 135 MB/s
> - 64K pages, DESC_RING_BUF_SZE = 64K: 138 MB/s
Thanks!
> From what you said, it looks like it may make a sense to reduce
> DESC_RING_BUF_SZ down to 4 KiB? If so, I'd suggest we do that in a
> separate patch, as this one actually fixes kernel panic when 16k/64k
> pages are enabled. Please let me know what you think.
Agreed, sounds good to me.
Arnd
next prev parent reply other threads:[~2024-08-27 7:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 23:20 [PATCH] mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K Sam Protsenko
2024-03-07 7:52 ` Arnd Bergmann
2024-04-02 22:43 ` Sam Protsenko
2024-04-04 9:28 ` Ulf Hansson
2024-08-27 1:28 ` Sam Protsenko
2024-08-27 7:27 ` Arnd Bergmann [this message]
2024-08-27 17:00 ` Sam Protsenko
2024-08-28 15:23 ` Ulf Hansson
2024-09-16 6:09 ` Ron Economos
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=bd334314-25f7-4e87-bcab-e3baed9a7ab5@app.fastmail.com \
--to=arnd@arndb.de \
--cc=anders.roxell@linaro.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=cjb@laptop.org \
--cc=dan.carpenter@linaro.org \
--cc=hch@lst.de \
--cc=jh80.chung@samsung.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=matt@console-pimps.org \
--cc=naresh.kamboju@linaro.org \
--cc=semen.protsenko@linaro.org \
--cc=sumit.semwal@linaro.org \
--cc=ulf.hansson@linaro.org \
--cc=will.newton@gmail.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