All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shaohua.li@intel.com>
To: Christoph Hellwig <hch@infradead.org>,
	Jens Axboe <axboe@kernel.dk>, "Ted Ts'o" <tytso@mit.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-ext4@vger.kernel.org
Subject: Re: [patch]ext4: add block plug for .writepages
Date: Sun, 09 Oct 2011 14:09:59 +0800	[thread overview]
Message-ID: <1318140599.22361.64.camel@sli10-conroe> (raw)
In-Reply-To: <1317179380.22361.8.camel@sli10-conroe>

On Wed, 2011-09-28 at 11:09 +0800, Shaohua Li wrote:
> On Mon, 2011-09-26 at 17:45 +0800, Christoph Hellwig wrote:
> > On Mon, Sep 26, 2011 at 03:38:47PM +0800, Shaohua Li wrote:
> > > On Mon, 2011-09-26 at 15:30 +0800, Christoph Hellwig wrote:
> > > > On Mon, Sep 26, 2011 at 10:30:26AM +0800, Shaohua Li wrote:
> > > > > Some filesystems implement .writepages. We don't have blk plug
> > > > > in such filesystems for .writepages.
> > > > 
> > > > Please add the plugging in the actual ->writepages instances.
> > > there are several filesystems have ->writepages. Can you share an hint
> > > why we don't add plugging in the do_writepages?
> > 
> > Because do_writepages is completely generic code with no knowledge of
> > block I/O.  I really don't want to have block plugging be intimately
> > tied into core VM/writeback code all over.  We've been there with
> > ->sync_page, and it was a major pain - nevermind the additional (small)
> > overhead for the not block based filesystems.
> I searched a little bit, looks only ext4 need it. here is the patch.
> 
> 
> Add block plug for ext4 .writepages. Though ext4 .writepages
> already handles request merge very well, block plug is still
> helpful to reduce block lock contention.
> 
ping


> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> 
> ---
>  fs/ext4/inode.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> Index: linux/fs/ext4/inode.c
> ===================================================================
> --- linux.orig/fs/ext4/inode.c	2011-09-28 10:13:50.000000000 +0800
> +++ linux/fs/ext4/inode.c	2011-09-28 10:23:31.000000000 +0800
> @@ -2046,6 +2046,7 @@ static int ext4_da_writepages(struct add
>  	struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb);
>  	pgoff_t done_index = 0;
>  	pgoff_t end;
> +	struct blk_plug plug;
>  
>  	trace_ext4_da_writepages(inode, wbc);
>  
> @@ -2124,6 +2125,7 @@ retry:
>  	if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages)
>  		tag_pages_for_writeback(mapping, index, end);
>  
> +	blk_start_plug(&plug);
>  	while (!ret && wbc->nr_to_write > 0) {
>  
>  		/*
> @@ -2188,6 +2190,7 @@ retry:
>  			 */
>  			break;
>  	}
> +	blk_finish_plug(&plug);
>  	if (!io_done && !cycled) {
>  		cycled = 1;
>  		index = 0;
> 



  reply	other threads:[~2011-10-09  6:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26  2:30 [patch]mm: add more blk plug Shaohua Li
2011-09-26  7:30 ` Christoph Hellwig
2011-09-26  7:38   ` Shaohua Li
2011-09-26  9:45     ` Christoph Hellwig
2011-09-28  3:09       ` [patch]ext4: add block plug for .writepages Shaohua Li
2011-10-09  6:09         ` Shaohua Li [this message]
2011-10-10 16:51         ` Ted Ts'o
2011-10-11  0:07           ` NamJae Jeon
2011-10-11  0:07             ` NamJae Jeon
2011-10-11 10:40           ` Kyungmin Park
2011-10-11 10:40             ` Kyungmin Park
2011-10-12  0:53             ` Shaohua Li

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=1318140599.22361.64.camel@sli10-conroe \
    --to=shaohua.li@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=hch@infradead.org \
    --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 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.