From: Jan Kara <jack@suse.cz>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Jan Kara <jack@suse.cz>, Andreas Dilger <adilger@dilger.ca>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: Re: Latency writing to an mlocked ext4 mapping
Date: Wed, 2 Nov 2011 21:17:07 +0100 [thread overview]
Message-ID: <20111102201707.GD31575@quack.suse.cz> (raw)
In-Reply-To: <CALCETrWNCy0VN-rQM-xPksiJ50DW-KM+w2NBprNOPhvnizZW=Q@mail.gmail.com>
On Tue 01-11-11 18:51:04, Andy Lutomirski wrote:
> On Tue, Nov 1, 2011 at 4:10 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> > On Tue, Nov 1, 2011 at 4:03 PM, Jan Kara <jack@suse.cz> wrote:
> >> Avoiding IO during a minor fault would be a decent thing which might be
> >> worth pursuing. As you properly noted "stable pages during writeback"
> >> requirement is one obstacle which won't be that trivial to avoid though...
> >
> > There's an easy solution that would be good enough for me: add a mount
> > option to turn off stable pages.
> >
> > Is the other problem just a race, perhaps? __block_page_mkwrite calls
> > __block_write_begin (which calls get_block, which I think is where the
> > latency comes from) *before* wait_on_page_writeback, which means that
> > there might not be any space allocated yet.
>
> I think I'm right (other than calling it a race). If I change my code to do:
>
> - map the file (with MCL_FUTURE set)
> - fallocate
> - dirty all pages
> - fsync
> - dirty all pages again
>
> in the non-real-time thread, then a short test that was a mediocre
> reproducer seems to work.
>
> This is annoying, though -- I'm not generating twice as much write I/O
> as I used to. Is there any way to force the delalloc code to do its
> thing without triggering writeback? I don't think fallocate has this
> effect.
fallocate() will preallocate blocks on disk backing the mapped page. That
should get rid of latency in __block_write_begin(). Extents will still be
marked as uninitialized, but conversion from uninitialized to initialized
state happens during writeback / IO completion so you should not care much
about it.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2011-11-02 20:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 0:39 Latency writing to an mlocked ext4 mapping Andy Lutomirski
2011-10-20 1:02 ` Andreas Dilger
2011-10-20 1:15 ` Andy Lutomirski
2011-10-20 2:17 ` Andy Lutomirski
2011-10-20 5:59 ` Andy Lutomirski
2011-10-25 12:26 ` Jan Kara
2011-10-28 23:37 ` Andy Lutomirski
2011-10-28 23:39 ` [PATCH] mm: Improve cmtime update on shared writable mmaps Andy Lutomirski
2011-11-01 22:53 ` Jan Kara
2011-11-01 23:02 ` Andy Lutomirski
2011-11-02 7:38 ` Christoph Hellwig
2011-11-02 15:02 ` Jan Kara
2011-11-02 15:19 ` Ted Ts'o
2011-10-31 23:10 ` Latency writing to an mlocked ext4 mapping Jan Kara
2011-10-31 23:14 ` Andy Lutomirski
2011-11-01 23:03 ` Jan Kara
2011-11-01 23:10 ` Andy Lutomirski
2011-11-02 1:51 ` Andy Lutomirski
2011-11-02 20:17 ` Jan Kara [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=20111102201707.GD31575@quack.suse.cz \
--to=jack@suse.cz \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
/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).