From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen)
To: Harun Scheutzow <harun04@scheutzow.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: vfat file system extreme fragmentation on multiprocessor
Date: Thu, 11 Sep 2008 17:20:01 -0400 [thread overview]
Message-ID: <20080911212001.GD31271@csclub.uwaterloo.ca> (raw)
In-Reply-To: <0ML31I-1KdsXT0vcs-0006v2@mrelayeu.kundenserver.de>
On Thu, Sep 11, 2008 at 10:11:05PM +0200, Harun Scheutzow wrote:
> At 21:10 11.09.2008, Lennart Sorensen wrote:
>
> Why do you start a flame war against fat fs without the proper knowledge? This is of no help.
I am not. FAT was nice and simple and did a nice job on floppies for
microsoft basic. Fragmentation was no big deal.
> ext2 is no magic bullet. As any other file system which does not rearrange clusters on the fly (this is defragmentation), it can only prevent fragmentation by wasting space, that means it seems not to fragment at 25 % full, but does at 90 %, just depending on size of files created. Initially wasting space and on-the-fly defragmentation can be done on FAT as well, if the driver likes to do.
Certainly true. I have had systems get amazingly slow with reiserfs3.6
in the past because I got too close to 100% full. When not full they
tend to behave quite nicely for many workloads. I am sure there are
workloads that will cause bad behaviour though.
> All this NOT the problem here. It is NOT what I'm asking for.
>
>
> >Now what would happen if you used ftruncate to extend the file you open
> >to a large size, and then started writing it, and then set the size
> >correctly at the end?
>
> Because ftruncate has to allocate the clusters the same way fwrite does, it would probably give the same results.
But would ftruncate be a single operation in the kernel, reserving all
the clusters at once from the filesystem? I doubt fwrite would write
50MB in a single chunk to any filesystem. If it does write a single
chunk in one system call, well then I am quite impressed actually.
> Anyway, I want to keep things simple. I do not know the final file size in advance, may be 550 MByte, often 200, but can be 5. It is perfectly ok to get 4 fragments per 200 MByte. All I suggest is that a file system which is told to write 50 MByte a piece, does so.
Well that's why I thought maybe requesting 50MB or 100MB at a time with
ftruncate might work OK, and if the kernel handles it as a single
operation and reserves all the clusters at once when calling ftruncate,
then you would avoid fragmentation. Seems simple enough and worth a
try. At least if it works then you get to control the fragment size,
even if you can't prevent fragments.
Unfortunately if I understand the fat code correctly in the kernel, the
fat driver doesn't permit extending files with ftruncate, only
shortening, so I guess that doesn't help at all.
> I do not want to synchronize the two applications, preventing them from writing at the same time. But currently this seems to be the only option.
That does seem like a pain. Not sure there are any other options in the
case of the fat filesystem under linux though.
--
Len Sorensen
next prev parent reply other threads:[~2008-09-11 21:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-11 18:01 Harun Scheutzow
2008-09-11 19:10 ` Lennart Sorensen
2008-09-11 19:36 ` H. Peter Anvin
2008-09-11 21:09 ` Lennart Sorensen
2008-09-11 21:43 ` H. Peter Anvin
2008-09-11 20:11 ` Harun Scheutzow
2008-09-11 21:20 ` Lennart Sorensen [this message]
2008-09-11 23:03 ` Harun Scheutzow
2008-09-11 23:50 ` Andrew Morton
[not found] <baZfg-1yC-3@gated-at.bofh.it>
[not found] ` <baZS2-2rX-15@gated-at.bofh.it>
2008-09-12 13:19 ` Bodo Eggert
2008-09-12 22:11 ` Harun Scheutzow
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=20080911212001.GD31271@csclub.uwaterloo.ca \
--to=lsorense@csclub.uwaterloo.ca \
--cc=harun04@scheutzow.de \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®