linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Wu Fengguang <fengguang.wu@intel.com>
Subject: Re: [PATCH] Fix mapping->writeback_index to point to the last written page
Date: Wed, 2 Mar 2011 23:18:08 +0100	[thread overview]
Message-ID: <20110302221808.GG7496@quack.suse.cz> (raw)
In-Reply-To: <4D676067.8050200@ce.jp.nec.com>

  Hello,

On Fri 25-02-11 16:55:19, Jun'ichi Nomura wrote:
> For range-cyclic writeback (e.g. kupdate), the writeback code sets
> a continuation point of the next writeback to mapping->writeback_index.
> 
> Current code sets the page next to the last written page.
> I think it's intended for sequential writer.
  Not exactly. The code is meant so that background writeback gets to
writing the end of a file which gets continuously dirtied (if we always
started at the beginning, nr_to_write could always get to 0 before we reach
end of the file).

> However, in many cases, sequential writer is writing in the middle of the page
> and it just redirties the last written page by continuing from that.
> 
> So the next writeback should try to continue from the last written page,
> not the next one.
> (If it's clean because the writer was on the page boundary,
>  pagevec_lookup_tag just skips it. So no problem.)
> 
> Otherwise, the last written page was left dirty until the writeback
> wraps around.
> 
> I.e. if the sequential dirtier has written on pagecache as '*'s below:
> 
>    |*******|*******|****---|-------|-------|     ( |---| is a page )
> 
> then, writeback happens:
> 
>    |-------|-------|-------|-------|-------|
> 
> and the dirtier continues:
> 
>    |-------|-------|----***|*******|*****--|
>                    A       B
> 
> Next writeback should start from page A, not B.
  Yes, this is downside of our current scheme. Have you actually observed
it in practice or is it mostly a theoretic concern?
 
But as I'm thinking about it, it wouldn't harm our original aim to do
what you propose and it can help this relatively common case. So I think
it's a good idea. Fengguang, what do you think?

								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

  reply	other threads:[~2011-03-02 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25  7:55 [PATCH] Fix mapping->writeback_index to point to the last written page Jun'ichi Nomura
2011-03-02 22:18 ` Jan Kara [this message]
2011-03-03  2:26   ` Jun'ichi Nomura
2011-03-03 13:31     ` Wu Fengguang
2011-03-03 14:08       ` Jan Kara
2011-03-04  1:45         ` Jun'ichi Nomura
2011-03-04  2:20           ` Wu Fengguang

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=20110302221808.GG7496@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=fengguang.wu@intel.com \
    --cc=j-nomura@ce.jp.nec.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 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).