mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [EXPERIMENT] Add new "flush" option
Date: Sun, 25 Dec 2005 15:05:00 -0800	[thread overview]
Message-ID: <20051225150500.317bb7b3.akpm@osdl.org> (raw)
In-Reply-To: <878xu99rxx.fsf@devron.myhome.or.jp>

OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> wrote:
>
> Andrew Morton <akpm@osdl.org> writes:
> 
> >> +	if (bdi_write_congested(bdi)) {
> >> +		mod_timer(&sb->flush_timer, jiffies + (HZ / 10));
> >> +		return;
> >> +	}
> >
> > The bdi_write_congested() test probably isn't doing anything useful: it
> > only returns true if there's really heavy writeout in progress.  Possibly
> > you could look at the disk queue accounting stats, work out how much I/O
> > has been happening lately.
> 
> Umm... If queue is too busy, we can't flush immediately. So, this code
> is delaying flush, and we can wait the more user's request by it, I think.

The thing is that bdi_write_congested() will only return true when the
queue is under really really heavy writeout.  Most of the time it just
won't trigger, so this code isn't doing anything very useful.

If you indeed want to implement something like "only sync the device when
it is otherwise idle" then some different approach will be needed.  One
which

a) detects when there is light writeout happening and which

b) detects when there are reads happening too.

I don't know whether any of this is particularly useful, really.  So I'd
suggest that we just remove the bdi_write_contested() test and leave it at
that.

I could be wrong, of course - if you have some testcase in which the
bdi_write_congested() test makes some perceptible difference then I'd be
interested in hearing about it.  If you put a printk in there, does it
trigger much?

  reply	other threads:[~2005-12-25 23:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-24 20:04 OGAWA Hirofumi
2005-12-25 12:19 ` Andrew Morton
2005-12-25 14:23   ` OGAWA Hirofumi
2005-12-25 23:05     ` Andrew Morton [this message]
2005-12-26 16:37       ` OGAWA Hirofumi
2005-12-26 19:00         ` OGAWA Hirofumi
2005-12-25 16:02   ` OGAWA Hirofumi

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=20051225150500.317bb7b3.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --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

all inboxes | Powered by JetHome®