Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] mtd: block2mtd: convert to folios
@ 2026-10-15  3:34 Tal Zussman
  2026-10-15  3:34 ` [PATCH 1/3] mtd: block2mtd: convert block2mtd_read() " Tal Zussman
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Tal Zussman @ 2026-10-15  3:34 UTC (permalink / raw)
  To: Joern Engel, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra
  Cc: Matthew Wilcox (Oracle), linux-mtd, linux-kernel, Tal Zussman

block2mtd still goes through the page wrappers around the folio page
cache API, each of which hides a compound_head() call. Convert the read,
write and erase paths to use folios directly. This removes a
compound_head() call per page in the read path and four per page in the
write and erase paths, and leaves the driver with no struct page usage.

Tested on KVM with the MTD test modules and fsx/fsstress on UBIFS with
no errors.

The numbers below are from mtd_speedtest, in MiB/s, by folio size,
except the last row, which is from the MEMERASE ioctl:

+------------------------------+-------+--------+---------+---------+
| Test                         | Folio |   Base | Patched |  Change |
+------------------------------+-------+--------+---------+---------+
| Eraseblock read (128 KiB)    |   4K  |  12545 |   12863 |   +2.5% |
|                              |  16K  |  12998 |   17229 |  +32.6% |
|                              |  64K  |  13009 |   19135 |  +47.1% |
+------------------------------+-------+--------+---------+---------+
| Eraseblock write (128 KiB)   |   4K  |   8773 |    8063 |  noisy* |
|                              |  16K  |   9529 |   13448 |  +41.1% |
|                              |  64K  |   9636 |   15934 |  +65.4% |
+------------------------------+-------+--------+---------+---------+
| Page read (512 B)            |   4K  |   3332 |    3501 |   +5.1% |
|                              |  16K  |   3332 |    3462 |   +3.9% |
|                              |  64K  |   3330 |    3479 |   +4.5% |
+------------------------------+-------+--------+---------+---------+
| Page write (512 B)           |   4K  |   2001 |    2054 |   +2.6% |
|                              |  16K  |   2000 |    2059 |   +3.0% |
|                              |  64K  |   2001 |    2064 |   +3.1% |
+------------------------------+-------+--------+---------+---------+
| 2-page read (1 KiB)          |   4K  |   5262 |    5436 |   +3.3% |
|                              |  16K  |   5292 |    5327 |   +0.7% |
|                              |  64K  |   5312 |    5385 |   +1.4% |
+------------------------------+-------+--------+---------+---------+
| 2-page write (1 KiB)         |   4K  |   3635 |    3712 |   +2.1% |
|                              |  16K  |   3650 |    3725 |   +2.1% |
|                              |  64K  |   3665 |    3768 |   +2.8% |
+------------------------------+-------+--------+---------+---------+
| Erase, blocks hold data      |   4K  |  15013 |  ~15900 |   ~+6%* |
| (mtd_speedtest)              |  16K  |  15222 |   22849 |  +50.1% |
|                              |  64K  |  15280 |   24233 |  +58.6% |
+------------------------------+-------+--------+---------+---------+
| Erase, already erased        |   4K  |   9558 |   13727 |  +43.6% |
| (MEMERASE ioctl)             |  16K  |   9558 |   16580 |  +73.5% |
|                              |  64K  |   9626 |   17754 |  +84.4% |
+------------------------------+-------+--------+---------+---------+

---
Tal Zussman (3):
      mtd: block2mtd: convert block2mtd_read() to folios
      mtd: block2mtd: convert _block2mtd_write() to folios
      mtd: block2mtd: convert _block2mtd_erase() to folios

 drivers/mtd/devices/block2mtd.c | 120 +++++++++++++++++-----------------------
 1 file changed, 51 insertions(+), 69 deletions(-)
---
base-commit: 2f7fa8d90694d21dce68ceabd8383252b111cfea
change-id: 20261012-block2mtd-folio-9ccb6639c05a

Best regards,
--  
Tal Zussman <tz2294@columbia.edu>


______________________________________________________
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:[~2026-10-15  9:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15  3:34 [PATCH 0/3] mtd: block2mtd: convert to folios Tal Zussman
2026-10-15  3:34 ` [PATCH 1/3] mtd: block2mtd: convert block2mtd_read() " Tal Zussman
2026-10-15  3:34 ` [PATCH 2/3] mtd: block2mtd: convert _block2mtd_write() " Tal Zussman
2026-10-15  3:34 ` [PATCH 3/3] mtd: block2mtd: convert _block2mtd_erase() " Tal Zussman
2026-10-15  3:45   ` sashiko-bot
2026-10-15  9:14     ` Miquel Raynal

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