On Tue, Aug 2, 2016 at 3:18 PM, Thomas Caputi <[email protected]> wrote:

> I sent these questions to Matt Ahrens, but it occurred to me later
> that this might be a better place to ask.


Guess I'll copy my response here then.

1) What does the ddt_phys_type_t enum represent and what do the values
> mean? Specifically, what is the difference between DDT_PHYS_DITTO and
> the others?
>

In the value of the DDE (ddt_phys_t), it can have up to 4 BP's, one for
each number of DVA's (single, double triple), plus one additional BP for
the extra "dedup ditto" copy.  The zpool manpage describes this:

       dedupditto=number
           Threshold for the number of block ditto copies. If the reference
           count for a deduplicated block increases above this number, a new
           ditto copy of this block is automatically stored. The default
           setting is 0 which causes no ditto copies to be created for
           deduplicated blocks. The miniumum legal nonzero setting is 100.


>
> 2) What does the ddt_class_t enum represent and what do the values
> mean? Why do we keep different dedup objects on disk and in-core for
> each class in this enum? This seems related to question 1.
>

The DDE's are separated out into 3 different "classes" each of which is
stored in its own ZAP object.  The reason for this is probably some alleged
performance benefit which was never well-measured.  The classes are:

DITTO - DDE's that have a "dedup ditto" copy, i.e. their refcount is > the
dedupditto property

DUPLICATE - DDE's that have refcount > 1 but < dedupditto

UNIQUE - DDE's with refcount == 1


>
> 3) It looks to me that each ddt_phys_t can support up to
> SPA_DVAS_PER_BP (3) DVAs and each ddt_entry_t can support up to
> DDT_PHYS_TYPES (4). Does that mean that the dedup table can store up
> to 12 copies of each dedup'd block? That seems a bit excessive.
>

Theoretically, yes, but that doesn't happen in practice.  Practically it
could be 1+2+3+1=7 (SINGLE + DOUBLE + TRIPLE + DITTO) DVAs.

--matt



-------------------------------------------
openzfs-developer
Archives: https://www.listbox.com/member/archive/274414/=now
RSS Feed: https://www.listbox.com/member/archive/rss/274414/28015062-cce53afa
Modify Your Subscription: 
https://www.listbox.com/member/?member_id=28015062&id_secret=28015062-f966d51c
Powered by Listbox: http://www.listbox.com

Reply via email to