M Markus Stockhausen #
Message details and related content
As this is my first patch to this mailing list, please excuse any formal wrongdoing. I'm willing to learn and appreciate any feedback. Depending on the RAID level md currently allows optimized rmw logic for write operations. It is totally missing in RAID6 code but might be included in the future. To support easier testing of such an implementation this patch allows manual control of the rmw/rcw descision through the new interface /sys/block/mdX/md/rmw_level. The configuration can handle three levels of control. rmw_level=0: rmw is disabled for all RAID levels. This level is enforced for RAID6 and from now on allowed for RAID4/5. Maybe it can support benchmark tests of very special configurations. rmw_level=1: Estimate rmw IOs and rcw IOs. Execute rmw only if we will save IOs. This equals the "old" unpatched behaviour and will be the default for RAID4/5. rmw_level=2: Execute rmw even if calculated IOs for rmw and rcw are equal. We might have higher CPU consumption because of calculating the parity twice but it can be benefical otherwise. E.g. RAID4 with fast dedicated paritiy disk/SSD. The option is implemented just to be forward-looking. If we switch/grow between RAID levels the flag will be automatically adapted to the default sane value required for that level. This patch is based on a helpful discussion about an older RAID6 rmw patch. See http://marc.info/?l=linux-raid&m=136660454912729&w=1