From: Jan Kara <jack@suse.cz>
To: Theodore Tso <tytso@mit.edu>,
Linux Kernel Developers List <linux-kernel@vger.kernel.org>,
Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 3/3] ext3: Avoid starting a transaction in writepage when not necessary
Date: Mon, 30 Mar 2009 15:22:08 +0200 [thread overview]
Message-ID: <20090330132208.GA30897@duck.suse.cz> (raw)
In-Reply-To: <20090327230341.GF5176@mit.edu>
[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]
On Fri 27-03-09 19:03:41, Theodore Tso wrote:
> On Fri, Mar 27, 2009 at 11:23:46PM +0100, Jan Kara wrote:
> > On Fri 27-03-09 16:24:31, Theodore Ts'o wrote:
> > > From: Jan Kara <jack@suse.cz>
> > >
> > > We don't have to start a transaction in writepage() when all the blocks
> > > are a properly allocated. Even in ordered mode either the data has been
> > > written via write() and they are thus already added to transaction's list
> > > or the data was written via mmap and then it's random in which transaction
> > > they get written anyway.
> > >
> > > This should help VM to pageout dirty memory without blocking on transaction
> > > commits.
> > >
> > > Signed-off-by: Jan Kara <jack@suse.cz>
> > > Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> > Please, use the patch below instead (and I'd also wait a few days for
> > Mingo to check whether it also helps him). It also changes data=writeback
> > mode in the same way and it adheres to coding style...
>
> FYI, Looks like Linus has already cherry-picked your first patch from
> LKML and dropped it into mainline. My other two patches haven't gone
> in yet as far as I can tell.
>
> So we'll need to do a delta patch that has the differences from your
> new patch and what Linus has already pulled into mainline.
Thanks for letting me know. Attached is a rediff against current
Linus's tree.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
[-- Attachment #2: 0001-ext3-Avoid-starting-a-transaction-in-writepage-when.patch --]
[-- Type: text/x-patch, Size: 1559 bytes --]
>From f53cf013259b9c782b79f4c1be49d5961884f867 Mon Sep 17 00:00:00 2001
From: Jan Kara <jack@suse.cz>
Date: Mon, 30 Mar 2009 15:14:28 +0200
Subject: [PATCH] ext3: Avoid starting a transaction in writepage when not necessary
This does the same as commit 9e80d407736161d9b8b0c5a0d44f786e44c322ea
(avoid starting a transaction when no block allocation is needed)
but for data=writeback mode of ext3. We also cleanup the data=ordered
case a bit to stick to coding style...
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/ext3/inode.c | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 4a09ff1..70c86b0 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1512,12 +1512,16 @@ static int ext3_ordered_writepage(struct page *page,
if (!page_has_buffers(page)) {
create_empty_buffers(page, inode->i_sb->s_blocksize,
(1 << BH_Dirty)|(1 << BH_Uptodate));
- } else if (!walk_page_buffers(NULL, page_buffers(page), 0, PAGE_CACHE_SIZE, NULL, buffer_unmapped)) {
- /* Provide NULL instead of get_block so that we catch bugs if buffers weren't really mapped */
- return block_write_full_page(page, NULL, wbc);
+ page_bufs = page_buffers(page);
+ } else {
+ page_bufs = page_buffers(page);
+ if (!walk_page_buffers(NULL, page_bufs, 0, PAGE_CACHE_SIZE,
+ NULL, buffer_unmapped)) {
+ /* Provide NULL get_block() to catch bugs if buffers
+ * weren't really mapped */
+ return block_write_full_page(page, NULL, wbc);
+ }
}
- page_bufs = page_buffers(page);
next prev parent reply other threads:[~2009-03-30 13:22 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-27 20:24 [PATCH 0/3] Ext3 latency improvement patches Theodore Ts'o
2009-03-27 20:24 ` [PATCH 1/3] block_write_full_page: Use synchronous writes for WBC_SYNC_ALL writebacks Theodore Ts'o
2009-03-27 20:24 ` [PATCH 2/3] ext3: Use WRITE_SYNC for commits which are caused by fsync() Theodore Ts'o
2009-03-27 20:24 ` [PATCH 3/3] ext3: Avoid starting a transaction in writepage when not necessary Theodore Ts'o
2009-03-27 22:23 ` Jan Kara
2009-03-27 23:03 ` Theodore Tso
2009-03-30 13:22 ` Jan Kara [this message]
2009-03-27 22:20 ` [PATCH 2/3] ext3: Use WRITE_SYNC for commits which are caused by fsync() Jan Kara
2009-03-27 20:55 ` [PATCH 1/3] block_write_full_page: Use synchronous writes for WBC_SYNC_ALL writebacks Jan Kara
2009-04-07 6:21 ` Andrew Morton
2009-04-07 6:50 ` Andrew Morton
2009-04-07 7:08 ` Jens Axboe
2009-04-07 7:17 ` Jens Axboe
2009-04-07 8:16 ` Jens Axboe
2009-04-07 7:23 ` Andrew Morton
2009-04-07 7:57 ` Jens Axboe
2009-04-07 19:09 ` Theodore Tso
2009-04-07 19:32 ` Jens Axboe
2009-04-07 21:44 ` Theodore Tso
2009-04-07 22:19 ` [PATCH] block_write_full_page: switch synchronous writes to use WRITE_SYNC_PLUG Theodore Tso
2009-04-07 23:09 ` Andrew Morton
2009-04-07 23:46 ` Theodore Tso
2009-04-08 8:08 ` Jens Axboe
2009-04-08 22:34 ` Andrew Morton
2009-04-09 17:59 ` Jens Axboe
2009-04-08 6:00 ` Jens Axboe
2009-04-08 15:26 ` Theodore Tso
2009-04-08 5:58 ` [PATCH 1/3] block_write_full_page: Use synchronous writes for WBC_SYNC_ALL writebacks Jens Axboe
2009-04-08 15:25 ` Theodore Tso
2009-04-07 14:19 ` Theodore Tso
2009-03-27 20:50 ` [PATCH 0/3] Ext3 latency improvement patches Chris Mason
2009-03-27 21:03 ` Chris Mason
2009-03-27 21:19 ` Jan Kara
2009-03-27 21:30 ` Theodore Tso
2009-03-27 21:54 ` Jan Kara
2009-03-27 23:09 ` Theodore Tso
2009-03-28 0:14 ` Jeff Garzik
2009-03-28 0:24 ` David Rees
2009-03-30 14:16 ` Ric Wheeler
2009-03-30 11:23 ` Aneesh Kumar K.V
[not found] ` <20090330112330.GA11357@skywalker>
2009-03-30 11:44 ` Chris Mason
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=20090330132208.GA30897@duck.suse.cz \
--to=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).