All of lore.kernel.org
 help / color / mirror / Atom feed
* size and depth of Tree Bucket
@ 2014-08-13 11:09 Viral Mehta
  2014-08-19 21:47 ` Gregory Farnum
  0 siblings, 1 reply; 3+ messages in thread
From: Viral Mehta @ 2014-08-13 11:09 UTC (permalink / raw)
  To: ceph-devel

Hi,

I was looking at ceph/crush/builder.c crush_make_tree_bucket() function,

I would like to understand what "size" argument refers to ? Generally speaking
Tree Size is Total Number of the nodes. And this would be the same as number of
items.

But, crush.h mentions that it is NOT true. Can someone shed some light ?
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: size and depth of Tree Bucket
  2014-08-13 11:09 size and depth of Tree Bucket Viral Mehta
@ 2014-08-19 21:47 ` Gregory Farnum
  2014-08-20  4:00   ` Sage Weil
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory Farnum @ 2014-08-19 21:47 UTC (permalink / raw)
  To: Viral Mehta; +Cc: ceph-devel

On Wed, Aug 13, 2014 at 4:09 AM, Viral Mehta <viral.vkm@gmail.com> wrote:
> Hi,
>
> I was looking at ceph/crush/builder.c crush_make_tree_bucket() function,
>
> I would like to understand what "size" argument refers to ? Generally speaking
> Tree Size is Total Number of the nodes. And this would be the same as number of
> items.
>
> But, crush.h mentions that it is NOT true. Can someone shed some light ?

This is some pretty opaque code, and I don't spend much time in it,
but just looking at the surroundings the argument is just the "size"
of the following array (int *items). It's the number of entries there
are within this bucket.
-Greg
Software Engineer #42 @ http://inktank.com | http://ceph.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: size and depth of Tree Bucket
  2014-08-19 21:47 ` Gregory Farnum
@ 2014-08-20  4:00   ` Sage Weil
  0 siblings, 0 replies; 3+ messages in thread
From: Sage Weil @ 2014-08-20  4:00 UTC (permalink / raw)
  To: Gregory Farnum; +Cc: Viral Mehta, ceph-devel

On Tue, 19 Aug 2014, Gregory Farnum wrote:
> On Wed, Aug 13, 2014 at 4:09 AM, Viral Mehta <viral.vkm@gmail.com> wrote:
> > Hi,
> >
> > I was looking at ceph/crush/builder.c crush_make_tree_bucket() function,
> >
> > I would like to understand what "size" argument refers to ? Generally speaking
> > Tree Size is Total Number of the nodes. And this would be the same as number of
> > items.
> >
> > But, crush.h mentions that it is NOT true. Can someone shed some light ?
> 
> This is some pretty opaque code, and I don't spend much time in it,
> but just looking at the surroundings the argument is just the "size"
> of the following array (int *items). It's the number of entries there
> are within this bucket.

Sorry I missed this thread earlier!

Normally size is the number of items.  In the tree bucket case, it is the 
power of 2 that is 2x the number of items (or something similar), as it is 
mixed up with the internal implementation (which puts items at the leaves 
and has internal nodes with weights).

Note that I believe there is a bug in the tree mapping code that hasn't 
been addressed just because nobody ever users it.  The default is straw 
and that is usually the right choice...

sage


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-20  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 11:09 size and depth of Tree Bucket Viral Mehta
2014-08-19 21:47 ` Gregory Farnum
2014-08-20  4:00   ` Sage Weil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.