commit grep author committer pickaxe re ? search:

hammer2 - live dedup, cleanup



* First attempt at a live dedup. The H2 strategy code now caches

{data_off, crc} info to track recently accessed data blocks. The

cache is checked in the strategy_write code after device-level

block encoding. If we get a cache hit, the disk block is compared

against the write data and reused if it matches.



* This 'live' dedup should catch most typical 'cp' or 'cpdup' style

commands. There will also be a bulk dedup capable of catching

everything.



* Note that 'df' output might be a bit confusing because the 'Used'

field represents the topology and does not take into account dedups.

'Avail' is calculated from the actual freemap. To make things look

right the total disk size is adjusted upward so it matches

Used+Avail. This mechanism will likely change.



Here is an example with one copy of /usr/src and 13 copies of /usr/src.

The first copy eats around 872MB, and a 'du' will show each copy eating

about the same. But because of dedup each subsequent copy actually only

eats around 160MB as you can see from the 'Avail' field:



test40# df -h /mnt

Filesystem Size Used Avail Capacity

/dev/serno/WD-WX51A82J2299.s1f@LOCAL 99G 934M 99G 1%

Filesystem Size Used Avail Capacity

/dev/serno/WD-WX51A82J2299.s1f@LOCAL 106G 8.5G 97G 8%



* Rename hammer2_bulkscan.c to hammer2_bulkfree.c since that is

basically all it does.



* Move the synchronization code to its own file, hammer2_synchro.c.

(note: This code is currently in rip-up mode and will not operate

properly).



15 files changed: