On Wed, Feb 14, 2018 at 02:23:29PM +0100, Mariusz Dabrowski wrote: > This patchset adds support for write hints in MD driver. This is a new > feature for NVMe drives compliant to 1.3 specification and introduced to > Linux in kernel 4.13. Write hint has to be copied from bio containing user > data to bios sent to RAID members. Additionally, write hint can be set for > internal data like parity and PPL in RAID 5. > > Setting write hint for parity is done with simple classification algorithm > which works for sequential IO workload. It tries to predict which parity > request are going to be overwritten in a moment and sets write hint for > them. This algorithm uses stripe cache to count updates of each parity > chunk. Parity request will be predicted as "soon-overwritten" if nubmer of > parity updates is smaller than number of data chunks in stripe. > > For PPL there is no special algorithm. It is updated very frequently so we > can set write hint for each PPL write. > > We have performed our internal tests which prove that setting write hint > for parity and PPL can significantly reduce write amplification. I can apply the first 2 patches first. For other patches, I'm not confident. A write hint just means a write stream, or a stream ID. Userspace doesn't need to assign shore live data to RWH_WRITE_LIFE_SHORT. It could assign long live data to RWH_WRITE_LIFE_SHORT but short live data to RWH_WRITE_LIFE_LONG. Nothing prevents userspace to do this. Fixed policy like what the patches do isn't flexible and sometimes harmful for performance depending on specific applications. Thanks, Shaohua > > Mariusz Dabrowski (5): > raid1: copy write hint from master bio to behind bio > raid5: copy write hint from origin bio to stripe > raid5: sysfs attribute for write hint policy > raid5: set write hint for parity > raid5: set write hint for PPL > > Documentation/admin-guide/md.rst | 16 +++++ > drivers/md/raid1.c | 2 + > drivers/md/raid5-ppl.c | 4 ++ > drivers/md/raid5.c | 147 +++++++++++++++++++++++++++++++++++++-- > drivers/md/raid5.h | 10 +++ > 5 files changed, 175 insertions(+), 4 deletions(-) > > -- > 2.16.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html