U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Cc: Tom Rini <trini@konsulko.com>,
	 Michael Trimarchi <michael@amarulasolutions.com>,
	 Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>,
	 Christian Marangi <ansuelsmth@gmail.com>,
	 u-boot@lists.denx.de
Subject: Re: [PATCH v2] cmd: mtd: fix speed measurement in the speed benchmark
Date: Thu, 28 Aug 2025 11:45:45 +0200	[thread overview]
Message-ID: <87tt1r6api.fsf@bootlin.com> (raw)
In-Reply-To: <20250826192131.340354-1-mikhail.kshevetskiy@iopsys.eu> (Mikhail Kshevetskiy's message of "Tue, 26 Aug 2025 22:21:31 +0300")

Hello,

On 26/08/2025 at 22:21:31 +03, Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> wrote:

> The shown speed inversely proportional to the data size.

                 ^ is

> See the output:
>
>   spi-nand: spi_nand nand@0: Micron SPI NAND was found.
>   spi-nand: spi_nand nand@0: 256 MiB, block size: 128 KiB, page size: 2048, OOB size: 128
>   ...
>   => mtd read.benchmark spi-nand0 $loadaddr 0 0x40000
>   Reading 262144 byte(s) (128 page(s)) at offset 0x00000000
>   Read speed: 63kiB/s
>   => mtd read.benchmark spi-nand0 $loadaddr 0 0x20000
>   Reading 131072 byte(s) (64 page(s)) at offset 0x00000000
>   Read speed: 127kiB/s
>   => mtd read.benchmark spi-nand0 $loadaddr 0 0x10000
>   Reading 65536 byte(s) (32 page(s)) at offset 0x00000000
>   Read speed: 254kiB/s
>
> In the spi-nand case 'io_op.len' is not always the same as 'len', thus
> we are using the wrong amount of data to derive the speed.
>
> The patch also updates the help for 'mtd read' command to show the presence
> of the benchmark option. The help for the 'mtd write' command help has not
> been changed to fit 80 character width restriction.

I would put this into a second commit, and anyway adapt the write
command as well. I do not think the 80 chars rule is so important here.

> Fixes: d246e70cf81d0 ("cmd: mtd: Enable speed benchmarking")
> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
> ---
>  cmd/mtd.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> Changes v2:
>  * update commit message
>  * 'Fixes:' tag was added
>  * calculate speed a bit more precisely using a 64-bit math

This should have been done in a separate patch. In general we prefer
atomic changes. It's okay as the diff is small, but as an example I'd
have instead done that with 3 patches:
- Fix the calculation (sf/io_op.len/len)
- Change the size because you fear 1h is not enough
- Document the commands

Anyway,

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

  reply	other threads:[~2025-08-28 14:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25 23:48 [PATCH] cmd: mtd: fix speed measurement in the speed benchmark Mikhail Kshevetskiy
2025-08-26 14:23 ` Miquel Raynal
2025-08-26 14:32   ` Michael Nazzareno Trimarchi
2025-08-26 14:35     ` Mikhail Kshevetskiy
2025-08-26 14:33   ` Mikhail Kshevetskiy
2025-08-26 14:59     ` Miquel Raynal
2025-08-26 19:21       ` [PATCH v2] " Mikhail Kshevetskiy
2025-08-28  9:45         ` Miquel Raynal [this message]
2025-08-29  7:48           ` [PATCH v3 0/2] cmd: mtd: fix benchmarking Mikhail Kshevetskiy
2025-08-29  7:48             ` [PATCH v3 1/2] cmd: mtd: fix speed measurement in the speed benchmark Mikhail Kshevetskiy
2025-08-29  7:48             ` [PATCH v3 2/2] cmd: mtd: add benchmark option to the help Mikhail Kshevetskiy
2025-08-29  7:55           ` [PATCH v4 0/2] cmd: mtd: fix benchmarking Mikhail Kshevetskiy
2025-08-29  7:55             ` [PATCH v4 1/2] Prepare v2025.10-rc3 Mikhail Kshevetskiy
2025-08-29  7:55             ` [PATCH v4 2/2] cmd: mtd: fix speed measurement in the speed benchmark Mikhail Kshevetskiy
2025-08-29  7:59           ` [PATCH v5 0/2] cmd: mtd: fix benchmarking Mikhail Kshevetskiy
2025-08-29  7:59             ` [PATCH v5 1/2] cmd: mtd: fix speed measurement in the speed benchmark Mikhail Kshevetskiy
2025-08-29  7:59             ` [PATCH v5 2/2] cmd: mtd: add benchmark option to the help Mikhail Kshevetskiy
2025-08-29 21:54               ` Miquel Raynal

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=87tt1r6api.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=ansuelsmth@gmail.com \
    --cc=michael@amarulasolutions.com \
    --cc=mikhail.kshevetskiy@iopsys.eu \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /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