From: Chris Mason <chris.mason@oracle.com>
To: linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] Properly init address_space->writeback_index
Date: Thu, 14 Aug 2008 14:13:40 -0400 [thread overview]
Message-ID: <1218737620.15342.386.camel@think.oraclecorp.com> (raw)
write_cache_pages uses i_mapping->writeback_index to pick up where it
left off the last time a given inode was found by pdflush or
balance_dirty_pages (or anyone else who sets wbc->range_cyclic)
alloc_inode should set it to a sane value so that writeback doesn't start
in the middle of a file. It is somewhat difficult to notice the bug since
write_cache_pages will loop around to the start of the file and the
elevator helps hide the resulting seeks.
For whatever reason, Btrfs hits this often. Unpatched, untarring 30 copies of
the linux kernel in series runs at 47MB/s on a single sata drive. With
this fix, it jumps to 62MB/s.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff -r 67160ae21a58 fs/inode.c
--- a/fs/inode.c Wed Aug 06 19:26:20 2008 -0700
+++ b/fs/inode.c Thu Aug 14 10:15:49 2008 -0400
@@ -166,6 +166,7 @@ static struct inode *alloc_inode(struct
mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE);
mapping->assoc_mapping = NULL;
mapping->backing_dev_info = &default_backing_dev_info;
+ mapping->writeback_index = 0;
/*
* If the block_device provides a backing_dev_info for client
next reply other threads:[~2008-08-14 18:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-14 18:13 Chris Mason [this message]
2008-08-14 19:05 ` [PATCH] Properly init address_space->writeback_index Andrew Morton
2008-08-14 19:35 ` Chris Mason
2008-08-14 19:55 ` Andrew Morton
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=1218737620.15342.386.camel@think.oraclecorp.com \
--to=chris.mason@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.