public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Measure read while write latency
@ 2022-11-10 15:59 Miquel Raynal
  2022-11-10 15:59 ` [PATCH 1/2] mtd-utils: flash_speed: Rework the time counting helpers Miquel Raynal
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Miquel Raynal @ 2022-11-10 15:59 UTC (permalink / raw)
  To: David Oberhollenzer
  Cc: Richard Weinberger, Vignesh Raghavendra, Tudor Ambarus,
	Pratyush Yadav, Michael Walle, linux-mtd, Julien Su, Jaime Liao,
	Thomas Petazzoni, Miquel Raynal

Macronix SPI-NOR flashes have Read-While-Write (RWW) capabilities. When programming/erasing big chunks of data, a subsequent read would take ages before being executed. If the area accessed by the read is not on the same bank of the program or erase, the read may just happen during the programming step (the bus being the bottleneck). Let's add a way to measure the latency gain with an additional flash_speed test.

By providing '-b <x> -k <y> -c <z> --destructive', reads will be attempted on blocks [y; y+z] just after starting writes on blocks [x; x+z]. The test tool gives the total time of the operation (close to making a write then a read, serially) as well as the time when the read was over. If the device does not support the RWW feature, or if the reads and writes target the same bank, the read will end last at the end of the full operation. Otherwise, when the RWW feature is leveraged, the read ends much earlier.

Example with a Macronix MX25UW51245G with bank and RWW support:

     // Testing the two accesses in the same bank
     $ flash_speed -b0 -k0 -c10 -d /dev/mtd0
     [...]
     testing read while write latency
     read while write took 51ms, read ended after 51ms

     // Testing the two accesses within different banks
     $ flash_speed -b0 -k4096 -c10 -d /dev/mtd0
     [...]
     testing read while write latency
     read while write took 51ms, read ended after 20ms

Thanks,
Miquèl

Miquel Raynal (2):
  mtd-utils: flash_speed: Rework the time counting helpers
  mtd-utils: flash_speed: Measure read while write latency

 tests/mtd-tests/Makemodule.am |   5 +-
 tests/mtd-tests/flash_speed.c | 165 ++++++++++++++++++++++++++++++----
 2 files changed, 150 insertions(+), 20 deletions(-)

-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-21  9:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-10 15:59 [PATCH 0/2] Measure read while write latency Miquel Raynal
2022-11-10 15:59 ` [PATCH 1/2] mtd-utils: flash_speed: Rework the time counting helpers Miquel Raynal
2022-11-10 15:59 ` [PATCH 2/2] mtd-utils: flash_speed: Measure read while write latency Miquel Raynal
2022-11-21  7:37 ` [PATCH 0/2] " David Oberhollenzer
2022-11-21  9:40   ` Pratyush Yadav
2022-11-21  9:47     ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox