linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tytso@mit.edu
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 4/4] ext4: Wait for proper transaction commit on fsync
Date: Wed, 9 Dec 2009 09:32:19 -0500	[thread overview]
Message-ID: <20091209143219.GF27692@thunk.org> (raw)
In-Reply-To: <20091209112940.GF4863@quack.suse.de>

On Wed, Dec 09, 2009 at 12:29:40PM +0100, Jan Kara wrote:
> On Tue 08-12-09 23:54:24, tytso@mit.edu wrote:
> > Here's a revised version of your patch that I've included in the ext4
> > patch queue.  I've removed the use of the atomic_t data type.  I've
>   OK, I'm just unsure: Isn't even 32-bit read non-atomic if it is not
> properly aligned e.g. on powerPC? So shouldn't we make sure those inode
> fields are aligned to 32-bit boundary (or at least add a comment about
> that)?

But gcc guarantees such alignments, unless you do something horrible
from a performance point of view, such as using
__attribute__((packed)).  And in fact, if things are not aligned, on
some platforms unaligned access will trigger a software trap, and the
kernel trap handler has to fix up the unaligned access.  (I believe
Power is one of these platforms if memory serves correctly.)  Even on
platforms that don't, the performance hit where the hardware has to do
the unaligned access so horrible that gcc avoids the misalignment
automatically.

That's why sometimes I'll go around and try to adjust structure member
orders, since something like this:

struct foo {
       short int a;
       int   b;
       short int c;
} foo_array[2];

Will consume 24 bytes.... while this:

struct foo {
       short int a;
       short int c;
       int   b;
} foo_array[2];

... will consume 16 bytes.  For structures that are used in huge
amounts (like inode slab caches), it can mean a measurable memory
savings.

						- Ted

  reply	other threads:[~2009-12-09 14:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-27 12:48 [PATCH 0/4] Fix fsync on ext3 and ext4 (v2) Jan Kara
2009-10-27 12:48 ` [PATCH 1/4] ext3: Wait for proper transaction commit on fsync Jan Kara
2009-10-27 12:48 ` [PATCH 2/4] ext4: Avoid issuing barriers on error recovery path Jan Kara
2009-11-16  0:47   ` Theodore Tso
2009-11-16  2:40     ` [PATCH] ext4: Avoid issuing unnecessary barriers Theodore Ts'o
2009-11-16 10:29       ` Jan Kara
2009-10-27 12:48 ` [PATCH 3/4] ext4: Fix error handling ext4_ind_get_blocks Jan Kara
2009-11-16  2:57   ` Theodore Tso
2009-10-27 12:48 ` [PATCH 4/4] ext4: Wait for proper transaction commit on fsync Jan Kara
2009-11-04 14:57   ` Andi Kleen
2009-11-04 15:53     ` Jan Kara
2009-11-16  0:46   ` Theodore Tso
2009-11-16 10:43     ` Jan Kara
2009-12-09  3:51       ` tytso
2009-12-09  4:54         ` tytso
2009-12-09 11:29           ` Jan Kara
2009-12-09 14:32             ` tytso [this message]
2009-12-09 11:30         ` Jan Kara
2009-11-05 13:02 ` [PATCH 0/4] Fix fsync on ext3 and ext4 (v2) Jan Kara
2009-11-05 16:35   ` Aneesh Kumar K.V
2009-11-11 14:17     ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2009-10-20  7:24 [PATCH 0/4] Fix fsync bug in ext3 and ext4 Jan Kara
2009-10-20  7:24 ` [PATCH 4/4] ext4: Wait for proper transaction commit on fsync Jan Kara
2009-10-20 12:31   ` Aneesh Kumar K.V
2009-10-20 16:05     ` Jan Kara
2009-10-20 14:36   ` Curt Wohlgemuth
2009-10-20 15:52     ` Jan Kara

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=20091209143219.GF27692@thunk.org \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).