All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sage Weil <sweil@redhat.com>
To: Loic Dachary <loic@dachary.org>
Cc: Ceph Development <ceph-devel@vger.kernel.org>
Subject: Re: crush multiweight implementation details
Date: Mon, 10 Apr 2017 14:11:40 +0000 (UTC)	[thread overview]
Message-ID: <alpine.DEB.2.11.1704101410300.2999@piezo.novalocal> (raw)
In-Reply-To: <6bcba5f9-7f68-bcf7-3f85-323b4fa6dd29@dachary.org>

On Mon, 10 Apr 2017, Loic Dachary wrote:
> Hi Sage,
> 
> We could have:
> 
> struct crush_choose_arg {
>   __u32 bucket_id;
>   __u32 num_items;
>   __u32 *ids; // override the bucket items for placement
>   __u32 num_positions;
>   __u32 *weights; // size is num_positions*num_items
> };
>  
> struct crush_choose_arg_map {
>   struct crush_choose_arg *args;
>   __u32 size;
> };
> 
> and
> 
> void crush_init_workspace(const struct crush_map *m, struct crush_choose_arg_map *arg_map, void *v) {
> ...
> if (m->buckets[b]->id == arg_map[b]->bucket_id)
>    w->work[b]->arg = arg_map[b];
> ...
> }
> 
> with
> 
> struct crush_work_bucket {
>     __u32 perm_x; /* @x for which *perm is defined */
>     __u32 perm_n; /* num elements of *perm that are permuted/defined */
>     __u32 *perm;  /* Permutation of the bucket's items */
>     struct crush_choose_arg *arg;
> };
> 
> There would be no need to change the code path since crush_bucket_choose 
> already is given the crush_work_bucket. And crush_init_workspace already 
> has logic that is algorithm dependent. And all the sanity checks could 
> be done in crush_init_workspace so that the choose function only does 
> what's absolutely necessary.

Allowing overrides of the bucket items too makes me nervous (do we have a 
use for that yet?), but otherwise this looks reasonable!

sage

  reply	other threads:[~2017-04-10 14:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 14:04 crush multiweight implementation details Loic Dachary
2017-04-10 14:11 ` Sage Weil [this message]
2017-04-10 14:39   ` Loic Dachary
2017-04-10 14:44     ` Sage Weil
2017-04-10 14:53       ` Loic Dachary
2017-04-11  6:49         ` Loic Dachary
2017-04-11 13:31           ` Sage Weil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.11.1704101410300.2999@piezo.novalocal \
    --to=sweil@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=loic@dachary.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.