Read-modify-write
A storage update that reads existing data needed to preserve unchanged information, combines it with replacement data, and writes the modified data and any required redundancy.
For a partial physical-sector update on a 512e drive, the merge is within a 4096-byte physical sector [5]. In parity RAID, RMW uses old changed-data blocks and old parity, rather than every unchanged block. A cold-cache one-block update has two reads and two writes for RAID5, or three and three for P+Q RAID6. These are member-block transfers, not fixed fractions of full-stripe throughput [3].
With u replacements and p parity blocks, cD coherently cached old changed-data blocks and cP old parity blocks reduce RMW reads to u+p-cD-cP; writes remain u+p [6]. Incoming replacement data is not an old-data cache hit. Linux v6.12 checks original-page validity and can force reconstruction when parity may be inconsistent even without a failed member [7].
Minimum preread count alone is not a recovery policy. Missing members, journals and partial-block writes need separate analysis. CPU atomic read-modify-write instructions are a different use of the name.
Relations
- related
- Advanced Format (4K), 512e emulation, 4Kn native sectors, Partition alignment, Solid-state drive (SSD), RAID 5, RAID 6, Parity RAID, RAID write hole, Write amplification, Reconstruct-write, Full-stripe write, Parity logging, Speculative partial write
Advantages
- Updates part of stored data while preserving the untouched information
- Can update parity without reading every unchanged data block
Limitations
- Extra reads create dependencies, but counting operations alone does not determine elapsed time
- A full-stripe update can avoid parity prereads but still writes redundancy and needs crash-consistency protection
- Sector alignment, RAID stripe coverage and SSD-internal write amplification describe different layers
Citations
- Chen et al. (1994): RAID: High-Performance, Reliable Secondary Storage; sections 3.2.5-3.3.2 and 4.1.1
- Seagate: Transition to Advanced Format 4K Sector Hard Drives, 512-byte emulation and alignment.
- Hesela: RAID write penalty is not a speed ratio; model and limitations
- Linux v6.12 drivers/md/raid5.c: uptodate_for_rmw() and handle_stripe_dirtying(), original-page validity, preread selection and recovery override.