]> git.karo-electronics.de Git - karo-tx-linux.git/commit
raid5: add an option to avoid copy data from bio to stripe cache
authorShaohua Li <shli@kernel.org>
Tue, 29 Apr 2014 11:13:58 +0000 (19:13 +0800)
committerNeilBrown <neilb@suse.de>
Mon, 5 May 2014 23:49:43 +0000 (09:49 +1000)
commitf6c56882043bbb626a5151eaf57393f49ea3e453
treea75b34a0c3b662397b3134d019996d4a399c676a
parent9a1571d0435817356fe24e4adac375290f831d41
raid5: add an option to avoid copy data from bio to stripe cache

The stripe cache has two goals:
1. cache data, so next time if data can be found in stripe cache, disk access
can be avoided.
2. stable data. data is copied from bio to stripe cache and calculated parity.
data written to disk is from stripe cache, so if upper layer changes bio data,
data written to disk isn't impacted.

In my environment, I can guarantee 2 will not happen. And BDI_CAP_STABLE_WRITES
can guarantee 2 too. For 1, it's not common too. block plug mechanism will
dispatch a bunch of sequentail small requests together. And since I'm using
SSD, I'm using small chunk size. It's rare case stripe cache is really useful.

So I'd like to avoid the copy from bio to stripe cache and it's very helpful
for performance. In my 1M randwrite tests, avoid the copy can increase the
performance more than 30%.

Of course, this shouldn't be enabled by default. It's reported enabling
BDI_CAP_STABLE_WRITES can harm some workloads before, so I added an option to
control it.

Neilb:
  changed BUG_ON to WARN_ON
  Removed some assignments from raid5_build_block which are now not needed.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c
drivers/md/raid5.h