Re: fsync on large files

Stephen C. Tweedie (sct@redhat.com)
Mon, 1 Feb 1999 13:11:43 GMT


Hi,

On Sun, 31 Jan 1999 00:25:29 +0100, Michael Marxmeier <mike@msede.com>
said:

> I would appreciate a suggestion how to aproach this problem:

> Problem:
> The fsync() seems to takes rather long and other kernel activity
> seems to stall while the fsync() is processed (~3-5 seconds).
> If the fsync() is disabled, this effect is said to disappear.
> This is 2.0.3[56] on an UP box.

> I remember it was mentioned in the past that ext2 fsync() has a
> problem with fsync on large files (there was a patch from Scott Laird
> <laird@pacificrim.net> which reverted to file_fsync() depending on
> file size).

That is what 2.2 does, yes. It does improve thing substantially.

> Is this still valid (i would guess so since the 2.2.x code is
> basically the same), would it help to change to SMP

No!

> (i'd guess not - first thing that 2.2.x does ist lock_kernel())

That lock is dropped as soon as the kernel stops actively computing: it
does not get held for the whole fsync() process.

> or is avoiding the ext2 fsync mechanism (as Scotts patch does) the
> best option?

Yes.

> Other options i can imagine: Use more (and smaller files) - the
> effects is said to become noticeable if file size extends 200 MB.
> Or is this effect unrelated and i should look elsewhere?

That would help somewhat, but obviously you would have more files to
fsync so you'd lose all of your gains unless you can restrict the fsync
to just a few files.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/