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:00:31 -0500 [thread overview]
Message-ID: <20091124130031.GA29044@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.
Sure, I'll work through it. I didn't look too closely at which field
was moved from the end of the struct to fill the hole. I'll only fill
holes if it doesn't disrupt the grouping.
Mike
next prev parent reply other threads:[~2009-11-24 13:00 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 [this message]
2009-11-24 13:21 ` Mike Snitzer
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=20091124130031.GA29044@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.