[Devel] [PATCH rh7 11/38] ploop: skip writes of zeroes to unallocated blocks by default

Andrey Smetanin asmetanin at virtuozzo.com
Fri May 15 09:48:12 PDT 2015


Reading from unallocated blocks returns zeroes =>
we can safely skip writes of zeroes to unallocated blocks.

As a lot of tests do "dd if=/dev/zero ...", this optimization is valuable.

Feature enabled, test results:
  [root at p2 ~]# echo 1 >/sys/block/ploop37803/ptune/check_zeros
  [root at p2 ~]# dd if=/dev/zero of=/mnt/sb-io-test bs=1M count=1k oflag=dsync
  1024+0 records in
  1024+0 records out
  1073741824 bytes (1.1 GB) copied, 1.58975 s, 675 MB/s

The impact on CPU utilization is negligible.

https://jira.sw.ru/browse/PSBM-22506
https://jira.sw.ru/browse/PSBM-22381

Signed-off-by: Konstantin Khorenko <khorenko at parallels.com>
Acked-by: Maxim V. Patlasov <mpatlasov at parallels.com>
---
 include/linux/ploop/ploop.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index d295cba..434789e 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -323,6 +323,7 @@ struct ploop_tunable
 .congestion_low_watermark = DEFAULT_PLOOP_MAXRQ/2, \
 .pass_flushes = 1, \
 .pass_fuas = 1, \
+.check_zeros = 1, \
 .max_active_requests = DEFAULT_PLOOP_BATCH_ENTRY_QLEN / 2, }
 
 struct ploop_stats
-- 
1.9.3




More information about the Devel mailing list