Subject: Re: msdosfs performance problem
To: Michael van Elst <mlelstv@serpens.de>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 11/30/2005 08:00:20
On Sun, Nov 27, 2005 at 11:23:02AM +0000, Michael van Elst wrote:
> I recently noticed that msdosfs reads from the disk when
> you write to it. The number of blocks read is almost the
> same as the number of blocks written.
...
> msdosfs just maps data blocks using the VM system and copies the
> written data in memory with uiomove(). The dirty blocks get page out
> later.
>
> I guess there is no optimization done for overwriting complete pages
> and the old data is first read from the disk before it gets overwritten.
that's right, for over-writing existing pages of a file, we currently
read the page in from backing store before overwriting it.
> If that is right, how do other filesystems avoid this problem?
they don't. fixing this has been on my to-do list for a long time,
but I'm hoping to get some time for it soon. it's slightly complicated
because we need to prevent other processes from accessing uninitialized
pages via mmap() before the write() copies in the new data. right now
we don't know track whether a file has any mappings, so we don't know
when this optimization is safe.
-Chuck