From: Theodore Tso <tytso@mit.edu>
To: linux-mm@kvack.org
Subject: [tytso@MIT.EDU: [PATCH, RFC] Use WRITE_SYNC in __block_write_full_page() if WBC_SYNC_ALL]
Date: Sun, 4 Jan 2009 17:08:29 -0500 [thread overview]
Message-ID: <20090104220829.GE22958@mit.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 157 bytes --]
Sorry, I screwed up the hostname for the linux-mm mailing list....
Comments, suggestions, et. al. appreciated. Many thanks,
- Ted
[-- Attachment #2: Type: message/rfc822, Size: 4530 bytes --]
From: "Theodore Ts'o" <tytso@MIT.EDU>
To: Andrew Morton <akpm@osdl.org>, linux-mm@vger.kernel.org, linux-ext4@vger.kernel.org, Arjan van de Ven <arjan@infradead.org>
Cc: Jens Axboe <jens.axboe@oracle.com>
Subject: [PATCH, RFC] Use WRITE_SYNC in __block_write_full_page() if WBC_SYNC_ALL
Date: Sun, 04 Jan 2009 16:52:46 -0500
Message-ID: <E1LJatq-00061O-0e@closure.thunk.org>
If wbc.sync_mode is WBC_SYNC_ALL, then in the page writeback paths we
will be waiting for the write to complete. So the I/O should be
submitted via submit_bh() with WRITE_SYNC so the block layer should
properly prioritize the I/O.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-mm@vger.kernel.org
---
Following up with an e-mail thread started by Arjan two months ago,
(subject: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority), I have
a patch, just sent to linux-ext4@vger.kernel.org, which fixes the jbd2
layer to submit journal writes via submit_bh() with WRITE_SYNC.
Hopefully this might be enough of a priority boost so we don't have to
force a higher I/O priority level via a buffer_head flag. However,
while looking through the code paths, in ordered data mode, we end up
flushing data pages via the page writeback paths on a per-inode basis,
and I noticed that even though we are passing in
wbc.sync_mode=WBC_SYNC_ALL, __block_write_full_page() is using
submit_bh(WRITE, bh) instead of submit_bh(WRITE_SYNC).
I'm not completely confident in my understanding of the page writeback
code paths --- does this change make sense?
- Ted
fs/buffer.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/buffer.c b/fs/buffer.c
index 10179cf..392b1b3 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1741,7 +1741,8 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
do {
struct buffer_head *next = bh->b_this_page;
if (buffer_async_write(bh)) {
- submit_bh(WRITE, bh);
+ submit_bh((wbc->sync_mode == WB_SYNC_ALL) ?
+ WRITE_SYNC : WRITE, bh);
nr_underway++;
}
bh = next;
@@ -1795,7 +1796,8 @@ recover:
struct buffer_head *next = bh->b_this_page;
if (buffer_async_write(bh)) {
clear_buffer_dirty(bh);
- submit_bh(WRITE, bh);
+ submit_bh((wbc->sync_mode == WB_SYNC_ALL) ?
+ WRITE_SYNC : WRITE, bh);
nr_underway++;
}
bh = next;
--
1.6.0.4.8.g36f27.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
reply other threads:[~2009-01-04 22:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20090104220829.GE22958@mit.edu \
--to=tytso@mit.edu \
--cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).