public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: ext4 development <linux-ext4@vger.kernel.org>,
	Jan Kara <jack@suse.cz>, Theodore Ts'o <tytso@mit.edu>
Subject: ext4 stable page writes question
Date: Tue, 09 Apr 2013 17:38:21 +0400	[thread overview]
Message-ID: <87txnf4yeq.fsf@openvz.org> (raw)


According to stable write assumptions (1d1d1a767206fb)
grab_cache_page_write_begin() now calls relaxed method wait_for_stable_page()
which will wait for writeback to finish only if bdi demand that.
Commit message states that ext4 may not wait
But there are a lot of write-paths where we expect that:
BUG_ON(!PageLocked(page));
BUG_ON(PageWriteback(page));
And the only reason we avoid this bugon is because of commit 47564bfb95b
which use following trick to avoid lock inversion over journal_start:
page = grab_cache_page_write_begin()
unlock_page(page);
ext4_journal_start()
lock_page(page);
wait_on_page_writeback(page); <<<< unconditional wait

So as far as I understand this was done just by occasion because
ext4_page_mkwrite() use wait_for_stable_page().

So here is my question:  Do we have to wait for page's writeback to
finish for all write paths in ext4 code or we may use
wait_for_stable_page() and should cleanup all places where 
we may trigger BUG_ON(PageWriteback(page));
 

             reply	other threads:[~2013-04-09 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 13:38 Dmitry Monakhov [this message]
2013-04-09 14:28 ` ext4 stable page writes question Jan Kara
2013-04-09 15:01   ` Dmitry Monakhov

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=87txnf4yeq.fsf@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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