Hi all, I want to request opinions on the block size returned by the FTL layer.
MTD drivers expose two "block sizes" on the geometry data: erase block size (the "flash page" size, which must be erased before writing) and the read/write block size (used for read/write operations). Classical block devices export just one block size. This is normal because this size is used for random access disks where you do not need to "erase" before writing. When the FTL driver exports a MTD "to look like" a block device, it passes (read/write) block size directly as the "simulated" block device's block size. This means file systems attaching to the FTL-exposed block device will typically try to break read/write operations in chunks of that size. As the underlying MTD requires erasing before writing, and erase size is typically N * block size, this results in multiple erase operations per write. I was thinking it might be better to use "erase block size" as "block size" when exporting an MTD as a block device through FTL. Functionality will not be affected; some filesystems (which size their buffer based on block device size) might use more buffers, but minimizing erases is usually the goal when accessing an MTD. Thoughts? Carlos
