All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: lvm-devel@redhat.com
Subject: Re: data alignment of structures with 'status'
Date: Tue, 24 Nov 2009 08:21:25 -0500	[thread overview]
Message-ID: <20091124132123.GA30655@redhat.com> (raw)
In-Reply-To: <20091123234425.GE26546@agk-dp.fab.redhat.com>

On Mon, Nov 23 2009 at  6:44pm -0500,
Alasdair G Kergon <agk@redhat.com> wrote:

> On Mon, Nov 23, 2009 at 06:23:45PM -0500, Mike Snitzer wrote:
> > /* Moving 'extents_copied' from after 'region_size' to after 'area_len' */
> > struct lv_segment {
> >         struct dm_list             list;                 /*     0    16 */
> >         struct logical_volume *    lv;                   /*    16     8 */
> >         const struct segment_type  * segtype;            /*    24     8 */
> >         uint32_t                   le;                   /*    32     4 */
> >         uint32_t                   len;                  /*    36     4 */
> >         uint64_t                   status;               /*    40     8 */
> >         uint32_t                   stripe_size;          /*    48     4 */
> >         uint32_t                   area_count;           /*    52     4 */
> >         uint32_t                   area_len;             /*    56     4 */
> 
> >         uint32_t                   extents_copied;       /*    60     4 */
> 
> But it doesn't logically fit there - it's a mirror field not an all-areas one
> or a snapshot one.  I'm only arguing for packing things efficiently
> if it can be done while keeping groups of related fields together (and
> normally it can be).
> 
> How about moving chunk_size from the end of the group of snapshot fields
> to the front instead?  I.e. rotating 3 uint32_t fields in what you've posted
> here.

Your chunk_size suggestion works perfectly.  I'll run with that.

Mike



      parent reply	other threads:[~2009-11-24 13:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-23 23:23 data alignment of structures with 'status' Mike Snitzer
2009-11-23 23:44 ` Alasdair G Kergon
2009-11-24 13:00   ` Mike Snitzer
2009-11-24 13:21   ` Mike Snitzer [this message]

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=20091124132123.GA30655@redhat.com \
    --to=snitzer@redhat.com \
    --cc=lvm-devel@redhat.com \
    /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.