public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: stan@hardwarefreak.com
Cc: Subranshu Patel <spatel.ml@gmail.com>, xfs@oss.sgi.com
Subject: Re: Xfs_repair and journalling  --  EXT4 journal replay discussion
Date: Sat, 30 Mar 2013 12:40:10 -0500	[thread overview]
Message-ID: <5157237A.40006@sandeen.net> (raw)
In-Reply-To: <5156DF72.1090703@hardwarefreak.com>

On 3/30/13 7:49 AM, Stan Hoeppner wrote:
> On 3/19/2013 5:14 AM, Stan Hoeppner wrote:
>> On 3/19/2013 3:24 AM, Martin Steigerwald wrote:
> ...
>>> Heck, even I was confused at first. Cause the manpage of fsck.ext4 IMHO is 
>>> not really clear about that topic to say the least. I tested it out for a 
>>> reason.
>>
>> I already contacted Ted off list hoping he can point me to the relevant
>> kernel documentation, so I don't make such a mistake again with EXT.
> 
> Ok, so here's the skinny on the source of our confusion WRT how/when
> EXT4 replays journals, and it's rather interesting.  Ted Ts'o explained
> the following.

Where was this, out of curiosity?

> The EXT4 kernel module does have code to perform journal replay, but it
> is rarely executed.  The reasons for this are:
> 
> 1.  EXT4 journal replay can take a lot of time (whereas XFS is instant)
> 2.  EXT4 systems tend to have multiple filesystems, often one per drive
>     (whereas XFS systems tend to have few filesystems)

Those are, I think, gross generalizations.  Journal replay takes as
long as it takes to replay all the IO required, which can vary greatly.
And TBH I have no idea where the notion came from that systems have many
ext4 filesystems but few xfs filesystems.

> 3.  Linux mounts filesystems serially during startup

I think that is correct.

> To prevent potentially lengthy boot times, the init scripts run e2fsck
> to replay all EXT4 filesystem journals in parallel, well before the
> mount stage.  

I'd never heard this rationale before, but I could believe that maybe
parallel log replays from userspace are faster, although it probably
depends a lot on how many spindles are available to do the work - fsck
avoids running in parallel for filesystems on the same physical disk,
at least according to the manpage.

> Thus the only case where the EXT4 kernel module performs
> journal replay is when doing a mount while the system is running, e.g.
> USB hard drive.

Or when running xfstests ;)  Technically, it does replay when the kernel
mount code finds a dirty log.  That's interesting, though, I hadn't thought
about how most systems probably don't get a ton of coverage of kernelspace
ext[34] log replay.

> There are other reasons e2fsck was chosen to perform journal replay at
> boot in addition to the speed issue, but as I understood Ted this is the
> main reason.

Ok, I can see some rationale to parallel userspace log replays; it'd be
interesting to actually measure that result, though.

-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-03-30 17:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16 15:56 Xfs_repair and journalling Subranshu Patel
2013-03-17  2:22 ` Stan Hoeppner
2013-03-17  3:01 ` Michael L. Semon
2013-03-17  5:26 ` Stan Hoeppner
2013-03-17 11:42   ` Subranshu Patel
2013-03-17 14:50     ` Stan Hoeppner
2013-03-17 15:18     ` Matthias Schniedermeyer
2013-03-17 23:20     ` Dave Chinner
2013-03-18 18:22     ` Ben Myers
2013-03-18 20:58       ` Martin Steigerwald
2013-03-18 20:50     ` Martin Steigerwald
2013-03-19  4:02     ` Eric Sandeen
2013-03-19  6:19       ` Stan Hoeppner
2013-03-19  8:24         ` Martin Steigerwald
2013-03-19 10:14           ` Stan Hoeppner
2013-03-30 12:49             ` Xfs_repair and journalling -- EXT4 journal replay discussion Stan Hoeppner
2013-03-30 17:40               ` Eric Sandeen [this message]
2013-03-30 18:52                 ` Stan Hoeppner
2013-03-30 20:21                   ` Eric Sandeen
2013-03-31 11:24                     ` Stan Hoeppner
2013-03-31  2:03                   ` Dave Chinner
2013-03-31  1:35               ` Dave Chinner
2013-03-18 20:37   ` Xfs_repair and journalling Martin Steigerwald

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=5157237A.40006@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=spatel.ml@gmail.com \
    --cc=stan@hardwarefreak.com \
    --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