Bypassing 4Kb Block Size Limitation on Block Layer/Device

Flash devices block size limitation

In order to reduce complexity, flash memory is divided into blocks of a given size. When a write is performed, an entire block must be erased and then written to. Since the erase destroys all data in the block, when a partial write is required the contents must be read into a temporary buffer, combined with the new data, the block erased, and the new data written out. When an entire block is written there is no need to read the previous contents, so writes are faster.

The device you are examining has 16kiB blocks, and so writes are fastest when performed in an exact multiple of that size starting on a block boundary.

How to disable request merges in Block device driver?

First check the nomerges value -

              cat /sys/block/sda/queue/nomerges

if it's not already 2, then do:

              echo 2 > /sys/block/sda/queue/nomerges


Related Topics



Leave a reply



Submit