[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090402095139.c2ff4f06.akpm@linux-foundation.org>
Date: Thu, 2 Apr 2009 09:51:39 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: David Rees <drees76@...il.com>
Cc: Janne Grunau <j@...nau.net>,
Lennart Sorensen <lsorense@...lub.uwaterloo.ca>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Theodore Tso <tytso@....edu>, Jesper Krogh <jesper@...gh.cc>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Linux 2.6.29
On Thu, 2 Apr 2009 09:33:44 -0700 David Rees <drees76@...il.com> wrote:
> On Thu, Apr 2, 2009 at 9:09 AM, Andrew Morton <akpm@...ux-foundation.org> wrote:
> > On Thu, 2 Apr 2009 13:05:32 +0200 Janne Grunau <j@...nau.net> wrote:
> >> MythTV calls fsync every few seconds on ongoing recordings to prevent
> >> stalls due to large cache writebacks on ext3.
> >
> > It should use sync_file_range(SYNC_FILE_RANGE_WRITE). __That will
> >
> > - have minimum latency. __It tries to avoid blocking at all.
> > - avoid writing metadata
> > - avoid syncing other unrelated files within ext3
> > - avoid waiting for the ext3 commit to complete.
>
> MythTV actually uses fdatasync, not fsync (or at least that's what it
> did last time I looked at the source). Not sure how the behavior of
> fdatasync compares to sync_file_range.
fdatasync() will still trigger the bad ext3 behaviour.
> Either way - forcing the data to be synced to disk a couple times
> every second is a hack and causes fragmentation in filesystems without
> delayed allocation. Fragmentation really goes up if you are recording
> multiple shows at once.
The file layout issue is unrelated to the frequency of fdatasync() -
the block allocation is done at the time of write().
ext3 _should_ handle this case fairly well nowadays - I thought we fixed that.
However it would probably benefit from having the size of the block reservation
window increased - use ioctl(EXT3_IOC_SETRSVSZ). That way, each file gets a
decent-sized hunk of disk "reserved" for its ongoing appending. Other
files won't come in and intermingle their blocks with it.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists