From: Andrew Morton <akpm@osdl.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: pbadari@us.ibm.com, linux-kernel@vger.kernel.org,
ext2-devel@lists.sourceforge.net
Subject: Re: ext3 reservation question.
Date: Wed, 21 Apr 2004 20:40:36 -0700 [thread overview]
Message-ID: <20040421204036.4e530732.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0404211959560.18945@ppc970.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
>
>
>
> On Wed, 21 Apr 2004, Badari Pulavarty wrote:
> >
> > I am worried about a case, where multiple threads writing to
> > different parts of same file - there by each thread thrashing
> > reservation window (since each one has its own goal).
>
> Didn't we have a patch two years ago or something floating around with
> doing lazy (delayed) block allocation on ext2 - doing the actual
> allocation only when writing the thing out? Then you shouldn't have this
> problem under any normal load, hopefully.
That would certainly help. I had delayed allocation for ext2 all up and
running in 2.5.7 or thereabouts - most of the complexity is in managing
filesystem space reservations. If you don't care about ENOSPC the VFS at
present "just works".
I do recall deciding that there were fundamental journal-related reasons
why delalloc couldn't be made to work properly on ext3.
ummm.
The code I had at the time would reserve space in the filesystem
correspnding to the worst-case occupancy based on file offset. When we
actually hit ENOSPC in prepare_write(), we force writeout, which results in
those worst-space reservations being collapsed into their _real_ space
usage, which is much less. So writeout reclaims space in the filesystem
and prepare_write() can proceed.
That worked fine on ext2. But on ext3 we have a transaction open in
prepare_write(), and the forced writeback will cause arbitrary amounts of
unexpected metadata to be pumped into the current transaction, causing the
fs to explode.
At least, I _think_ that was the problem. All is hazy.
Alex Tomas has current patches which do delalloc, but I don't know if they
do all the reservation stuff yet.
We would still face layout problems on SMP - two or more CPUs allocating
blocks in parallel. Could be solved by serialising writeback in some
manner - the fs-writeback.c code does that to some extent already.
next prev parent reply other threads:[~2004-04-22 3:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-21 23:55 Badari Pulavarty
2004-04-22 1:08 ` Andrew Morton
2004-04-22 3:05 ` Linus Torvalds
2004-04-22 3:40 ` Andrew Morton [this message]
2004-04-22 13:43 ` Chris Mason
2004-04-23 5:22 ` Alex Tomas
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=20040421204036.4e530732.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=ext2-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pbadari@us.ibm.com \
--cc=torvalds@osdl.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®