From: "Josef 'Jeff' Sipek" <jeffpc@josefsipek.net>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] fix dir2 shortform structures on ARM old ABI
Date: Sat, 15 Mar 2008 00:51:47 -0400 [thread overview]
Message-ID: <20080315045147.GB28242@josefsipek.net> (raw)
In-Reply-To: <47DB51A3.70200@sandeen.net>
On Fri, Mar 14, 2008 at 11:33:39PM -0500, Eric Sandeen wrote:
> Josef 'Jeff' Sipek wrote:
> > On Fri, Mar 14, 2008 at 11:23:43PM -0500, Eric Sandeen wrote:
> >> Josef 'Jeff' Sipek wrote:
>
> >>> Shouldn't this be unconditional? Just because it ends up being ok on x86
> >>> doesn't mean that it won't break some time later on...(do we want another
> >>> bad_features2 incident?)
> >> I think that packing structures when they don't need to be can actually
> >> be harmful, efficiency-wise. I read a nice explanation of this....
> >> which I can't find now.
> >
> > Agreed. For in-memory only structures it makes sense to let the compiler do
> > whatever is the best, but for structures that are on-disk, you really have
> > no choice, you have to have the same layout in memory - which frequently
> > means packed. Unless I missed it, the structs you modified are on-disk, and
> > therefore _must_ be the way the docs say - which happens to be packed.
>
> Well, the docs probably don't actually say "packed" :) ... they just
> assume standard/predictable layout of the structures.
Ok, nitpicking, eh? Well, you started ;)
Yes, it is true that they don't say packed, but at the same time they don't
define any holes, and the best way to force the compiler to not make holes
is to pack the structure.
> So on almost all architectures they _don't_ need to be explicitly
> packed, and it's my understanding that doing so when it's not neccessary
> is harmful. But these 3 cases, on the odd arm abi, do need it.
My understanding of the "harmful" case is that of unaligned word access, but
the compiler takes care of that.
All in all, all the ABIs that get the right alignment without packing will
not suffer performance-wise, and the old arm ABI needs to be packed anyway.
Now, next time Linux gets ported to an architecture - if that arch has a
"bad" alignment ABI rules, XFS will break, and someone (I nominate you :-P )
will have to augment the #if...or just use packed and forget about the whole
issue. :)
Josef 'Jeff' Sipek, wondering exactly how passionate one can get about
structure member alignment :)
--
Research, n.:
Consider Columbus:
He didn't know where he was going.
When he got there he didn't know where he was.
When he got back he didn't know where he had been.
And he did it all on someone else's money.
next prev parent reply other threads:[~2008-03-15 4:51 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-15 3:24 [PATCH] fix dir2 shortform structures on ARM old ABI Eric Sandeen
2008-03-15 4:17 ` Josef 'Jeff' Sipek
2008-03-15 4:23 ` Eric Sandeen
2008-03-15 4:27 ` Josef 'Jeff' Sipek
2008-03-15 4:33 ` Eric Sandeen
2008-03-15 4:51 ` Josef 'Jeff' Sipek [this message]
2008-03-17 18:32 ` Eric Sandeen
2008-03-17 19:53 ` Josef 'Jeff' Sipek
2008-03-17 20:04 ` Eric Sandeen
2008-03-17 20:28 ` Josef 'Jeff' Sipek
2008-03-18 0:39 ` [RFC][PATCH 1/1] XFS: annotate all on-disk structures with __ondisk Josef 'Jeff' Sipek
2008-03-18 3:34 ` Eric Sandeen
2008-03-18 4:09 ` David Chinner
2008-03-18 5:28 ` Josef 'Jeff' Sipek
2008-03-17 23:35 ` [PATCH] fix dir2 shortform structures on ARM old ABI Timothy Shimmin
2008-03-17 23:42 ` Josef 'Jeff' Sipek
2008-03-18 4:31 ` Timothy Shimmin
[not found] ` <20080315043622.GA11547@puku.stupidest.org>
2008-03-15 4:45 ` Eric Sandeen
2008-03-20 3:02 ` Eric Sandeen
2008-05-05 7:38 ` Barry Naujok
2008-06-06 14:15 ` Eric Sandeen
2008-04-09 19:53 ` Eric Sandeen
2008-04-23 0:58 ` Eric Sandeen
2008-05-02 20:55 ` Eric Sandeen
2008-05-05 7:08 ` David Chinner
2008-05-05 13:07 ` Eric Sandeen
2008-05-06 4:21 ` Timothy Shimmin
2008-05-06 13:43 ` Eric Sandeen
2008-06-05 5:38 ` Eric Sandeen
2008-06-05 5:46 ` Mark Goodwin
2008-06-05 5:49 ` Eric Sandeen
2008-06-05 6:02 ` Mark Goodwin
2008-06-05 6:04 ` Mark Goodwin
2008-06-05 6:06 ` Eric Sandeen
2008-06-05 5:49 ` Chris Wedgwood
2008-06-05 5:52 ` Eric Sandeen
2008-06-05 6:34 ` Eric Sandeen
-- strict thread matches above, loose matches on Subject: below --
2008-03-18 23:31 Andre Draszik
2008-03-19 3:18 ` Eric Sandeen
2008-03-19 3:40 ` Eric Sandeen
2008-03-19 5:11 ` Eric Sandeen
2008-03-19 5:31 ` Eric Sandeen
2008-03-20 0:35 ` Timothy Shimmin
2008-03-18 23:49 Andre Draszik
2008-03-19 0:23 ` Josef 'Jeff' Sipek
2008-03-19 11:21 ` Luca Olivetti
2008-03-19 12:53 ` Eric Sandeen
2008-03-19 14:11 ` Luca Olivetti
[not found] ` <47E11F4A.3090205@ventoso.org>
[not found] ` <47E12D20.4010901@sandeen.net>
2008-03-19 15:34 ` Luca Olivetti
2008-03-19 15:40 ` Eric Sandeen
[not found] ` <47E14FF1.2020100@sandeen.net>
2008-03-19 18:24 ` Luca Olivetti
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=20080315045147.GB28242@josefsipek.net \
--to=jeffpc@josefsipek.net \
--cc=sandeen@sandeen.net \
--cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox