[dm-devel] dm thin: optimize away writing all zeroes to unprovisioned blocks

Mike Snitzer snitzer at redhat.com
Fri Dec 5 14:47:39 UTC 2014


On Thu, Dec 04 2014 at 10:33am -0500,
Mike Snitzer <snitzer at redhat.com> wrote:

> From: Mike Snitzer <snitzer at redhat.com>
> Date: Thu, 4 Dec 2014 10:18:32 -0500
> Subject: [PATCH] dm thin: optimize away writing all zeroes to unprovisioned blocks
> 
> Introduce bio_is_zero_filled() and use it to optimize away writing all
> zeroes to unprovisioned blocks.  Subsequent reads to the associated
> unprovisioned blocks will be zero filled.
> 
> Signed-off-by: Mike Snitzer <snitzer at redhat.com>
> Cc: Eric Wheeler <ewheeler at ewheeler.net>
> Cc: Jens Axboe <axboe at kernel.dk>

In testing this patch it is now quite clear that this change seriously
impacts test coverage in the device-mapper-test-suite because dmts'
wipe_device() uses /dev/zero as the ifile for dd to write to the disk.
As such, with this patch all tests expecting to see provisioned blocks
as a side-effect of wipe_device now fail (e.g. DiscardQuickTests).

So this change won't go upstream until full test coverage can be
restored in dmts.  I'll see what I can come up with but it is low
priority.

BTW, this also makes me wonder if this change will be extremely
unintuitive to existing or future user of DM thinp.  So much so that it
might be best to require a new thin-pool feature flag to enable this
optimization.

Mike




More information about the dm-devel mailing list