[PATCH mtd-utils] mtd-tests: Read and write pages during speed tests

Richard Weinberger richard at nod.at
Wed Oct 13 04:12:43 PDT 2021


----- Ursprüngliche Mail -----
> Von: "Miquel Raynal" <miquel.raynal at bootlin.com>
> An: "david oberhollenzer" <david.oberhollenzer at sigma-star.at>
> CC: "richard" <richard at nod.at>, "Vignesh Raghavendra" <vigneshr at ti.com>, "Tudor Ambarus" <Tudor.Ambarus at microchip.com>,
> "linux-mtd" <linux-mtd at lists.infradead.org>, "Miquel Raynal" <miquel.raynal at bootlin.com>
> Gesendet: Mittwoch, 13. Oktober 2021 12:08:07
> Betreff: [PATCH mtd-utils] mtd-tests: Read and write pages during speed tests

> The speed test does reads and writes of different sizes:
> - eraseblock
> - page
> - two pages
> 
> At least this is the theory because, as opposed to the legacy kernel
> module doing the same measurement, the userspace tool uses the subpage
> size (hence accessing the same page 4, 8 or 16 times depending on the
> subpage setting). Of course if the controller does not support subpages,
> this issue is not visible.
> 
> Use mtd.min_io_size instead for non-NOR devices in order to get the
> right bandwidth (at least one that fits the logs).
> 
> Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
> ---
> tests/mtd-tests/flash_speed.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/mtd-tests/flash_speed.c b/tests/mtd-tests/flash_speed.c
> index 0058269..2fc70a1 100644
> --- a/tests/mtd-tests/flash_speed.c
> +++ b/tests/mtd-tests/flash_speed.c
> @@ -343,7 +343,7 @@ int main(int argc, char **argv)
> 		puts("not NAND flash, assume page size is 512 bytes.");
> 		pgsize = 512;
> 	} else {
> -		pgsize = mtd.subpage_size;
> +		pgsize = mtd.min_io_size;

Now the userspace does the same as the kernel test.
On the kernel side it uses mtd->writesize.

Reviewed-by: Richard Weinberger <richard at nod.at>

Thanks,
//richard



More information about the linux-mtd mailing list