From: Eric Sandeen <sandeen@redhat.com>
To: Fredrik Andersson <nablaman@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Fwd: Ext4 bug with fallocate
Date: Tue, 27 Oct 2009 10:37:15 -0500 [thread overview]
Message-ID: <4AE713AB.9060005@redhat.com> (raw)
In-Reply-To: <a125a870910270829u794853c4x370d2bae86499de4@mail.gmail.com>
Fredrik Andersson wrote:
>> To try to emulate, how does it write into the preallocated space; large or
>> small IOs? Sequential streaming? mmap writes? It may not be relevant but
>> would be nice to try to match it as closely as possible.
>
> This is a big file that is written sequentially using stdio buffered
> I/O (with a setvbuf of about 4K) in the drdbmake process. No mmap.
> It is regenerated from an earlier version of the same file, and we
> preallocate a file that is 25% bigger than the
> previous version, to allow for more data than was in the previous file
> and to utilize the extent concept in ext4.
FWIW, you do not need to preallocate to get extents. Preallocation
fundamentally only guarantees space available (somewhere) though in
practice, it can lead to more contiguous allocation of that space since
it's all done up front ...
> We then read the previous file sequentially, update some entries here
> and there and
> rewrite it sequentially into the new, fallocated file. There is one
> single instance of random I/O: Once the whole new
> file has been written, we seek back to the start to write a fixed-size
> header. We then ftruncate the file to the proper size.
> No process is concurrently reading from the file that is being
> written. There is however another process, nodeserv,
> that does random reads from the "previous" file (the one we're
> sequentially reading in drdbmake).
> The deadlock is always in the final ftruncate. It does not help to
> close the file and reopen it again before the ftruncate call.
Thanks. If find time to think enough about the backtraces you sent
it'll probably be obvious, but the complete description of your workload
is helpful.
Just out of curiosity have you verified that the deadlock doesn't exist
if you skip the preallocation? I wonder about a fake test where you
simply write a bit extra, and truncate that back.
-Eric
> /Fredrik
prev parent reply other threads:[~2009-10-27 15:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <a125a870910180836i66781e1ey8113e7f8569f1fad@mail.gmail.com>
2009-10-18 15:47 ` Fwd: Ext4 bug with f Fredrik Andersson
2009-10-18 15:57 ` Fwd: Ext4 bug with fallocate Eric Sandeen
2009-10-19 9:49 ` Fredrik Andersson
2009-10-20 16:49 ` Fredrik Andersson
2009-10-21 0:24 ` Mingming
2009-10-22 7:37 ` Fredrik Andersson
2009-10-26 10:43 ` Fredrik Andersson
2009-10-21 2:20 ` Eric Sandeen
2009-10-21 9:08 ` Fredrik Andersson
2009-10-27 4:42 ` Eric Sandeen
2009-10-27 8:17 ` Fredrik Andersson
2009-10-27 13:56 ` Eric Sandeen
2009-10-27 15:29 ` Fredrik Andersson
2009-10-27 15:37 ` Eric Sandeen [this message]
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=4AE713AB.9060005@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=nablaman@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).