<div dir="ltr">We're pleased to announce the first release candidate of v1.0.0 of the<br>thin-provisioning-tools (which also contains tools for dm-cache and<br>dm-era).<br><br>Please try it out on your test systems and give us feedback.  In<br>particular regarding documentation, build and install process.<br><br>    <a href="https://github.com/jthornber/thin-provisioning-tools">https://github.com/jthornber/thin-provisioning-tools</a><br><br><br># Rust<br><br>This is a complete rewrite of the tools in the Rust language.  This switch<br>was made for three primary reasons:<br><br>- Memory safety.<br>- The type system makes it easier to reason about multithreaded code and we need<br>  to use multiple threads to boost performance.<br>- Rust is a more expressive language than C++ (eg, proper algebraic data types).<br><br># IO engines<br><br>The old C++ tools used libaio for all IO.  The Rust version by default<br>uses traditional synchronous IO.  This sounds like a step backwards,<br>but the use of multiple threads and IO scheduling means there's a big<br>leap in performance.<br><br>In addition there's a compile time option to include asynchronous<br>IO support via io_uring.  This engine is slightly faster, but not all<br>distributions support io_uring at the moment.  In addition we've seen<br>recent (summer 2022) kernel versions that lose io notifications, causing<br>us to feel that io_uring itself isn't quite ready.<br><div><br></div><div># Performance<br><br>We've focussed on thin_check and cache_check performance most of all<br>since these regularly get run on system startup.  But all tools should<br>have made significant performance improvements.<br><br>Over the years we've collected some gnarly dm-thin metadata examples from<br>users, eg, using hundreds of thousands of snapshots, and completely<br>filling the maximum metadata size of 16G.  These are great for<br>benchmarking, for example running thin_check on my system with one of these files:<br><br>    thin_check (v0.9):                  6m<br>    thin_check (v1.0, sync engine):     28s  (12.9 times faster)<br>    thin_check (v1.0, io_uring engine): 23s  (15.6 times faster)<br><br># thin_dump/restore retains snapshot sharing <br><br>Another issue with previous versions of the tools is dumping and restoring<br>thin metadata would have the effect of losing sharing of the metadata<br>btrees for snapshots.  Meaning restored metadata often took up more space, and<br>in some cases would exceed the 16G metadata limit.  This is no longer the case.<br><br>[note: _data_ sharing was always maintained, this is purely about metadata space usage]<br><br># thin_metadata_pack/unpack<br><br>These are a couple of new tools that are used for support.  They compress<br>thin metadata, typically to a tenth of the size (much better than you'd<br>get with generic compressors).  This makes it easier to pass damaged<br>metadata around for inspection.<br></div><div><br></div><div># blk-archive<br><br>The blk-archive tools were initially part of this thin-provisioning-tools<br>package.  But have now been split off to their own project:<br><br>    <a href="https://github.com/jthornber/blk-archive">https://github.com/jthornber/blk-archive</a><br><br>They allow efficient archiving of thin devices (data deduplication<br>and compression).  Which will be of interest to those of you who are<br>holding large numbers of snapshots in thin pools as a poor man's backup.<br><br>In particular:<br><br>    - Thin snapshots can be used to archive live data.<br>    - it avoids reading unprovisioned areas of thin devices.<br>    - it can calculate deltas between thin devices to minimise<br>      how much data is read and deduped (incremental backups).<br>    - restoring to a thin device tries to maximise data sharing<br>      within the thin pool (a big win if you're restoring snapshots).<br></div></div>