On 4/28/11 12:45 PM, Edward Ned Harvey wrote:
From: Erik Trimble [mailto:erik.trim...@oracle.com]

OK, I just re-looked at a couple of things, and here's what I /think/ is
the correct numbers.

I just checked, and the current size of this structure is 0x178, or 376
bytes.

Each ARC entry, which points to either an L2ARC item (of any kind,
cached data, metadata, or a DDT line) or actual data/metadata/etc., is
defined in the struct "arc_buf_hdr" :

http://src.opensolaris.org/source/xref/onnv/onnv-
gate/usr/src/uts/common/fs/zfs/arc.c#431

It's current size is 0xb0, or 176 bytes.

These are fixed-size structures.
heheheh...  See what I mean about all the conflicting sources of
information?  Is it 376 and 176?  Or is it 270 and 200?
Erik says it's fixed-size.  Richard says "The DDT entries vary in size."

So far, what Erik says is at least based on reading the source code, with a
disclaimer of possibly misunderstanding the source code.  What Richard says
is just a statement of supposed absolute fact without any backing.

In any event, thank you both for your input.  Can anyone answer these
authoritatively?  (Neil?)   I'll send you a pizza.  ;-)


- I wouldn't consider myself an authority on the dedup code.
The size of these structures will vary according to the release you're running. 
You can always find out the size for a particular system using ::sizeof within
mdb. For example, as super user :

: xvm-4200m2-02 ; echo ::sizeof ddt_entry_t | mdb -k
sizeof (ddt_entry_t) = 0x178
: xvm-4200m2-02 ; echo ::sizeof arc_buf_hdr_t | mdb -k
sizeof (arc_buf_hdr_t) = 0x100
: xvm-4200m2-02 ;

This shows yet another size. Also there are more changes planned within
the arc. Sorry, I can't talk about those changes and nor when you'll
see them.

However, that's not the whole story. It looks like the arc_buf_hdr_t
use their own kmem cache so there should be little wastage, but the
ddt_entry_t are allocated from the generic kmem caches and so will
probably have some roundup and unused space. Caches for small buffers
are aligned to 64 bytes. See kmem_alloc_sizes[] and comment:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/uts/common/os/kmem.c#920

Pizza: Mushroom and anchovy - er, just kidding.

Neil.



_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to