All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Kautuk Consul <consul.kautuk@gmail.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>,
	Mel Gorman <mgorman@suse.de>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Jan Kara <jack@suse.cz>, Dave Chinner <david@fromorbit.com>,
	Greg Thelen <gthelen@google.com>
Subject: Re: [PATCH] writeback: Per-block device bdi->dirty_writeback_interval and bdi->dirty_expire_interval.
Date: Fri, 19 Aug 2011 10:34:06 +0800	[thread overview]
Message-ID: <20110819023406.GA12732@localhost> (raw)
In-Reply-To: <CAFPAmTShNRykOEbUfRan_2uAAbBoRHE0RhOh4DrbWKq7a4-Z9Q@mail.gmail.com>

Hi Kautuk,

On Fri, Aug 19, 2011 at 12:25:58AM +0800, Kautuk Consul wrote:
> 
> Lines: 59
> 
> Hi Wu,
> 
> On Thu, Aug 18, 2011 at 6:43 PM, Wu Fengguang <fengguang.wu@intel.com> wrote:
> > Hi Artem,
> >
> >> Here is a real use-case we had when developing the N900 phone. We had
> >> internal flash and external microSD slot. Internal flash is soldered in
> >> and cannot be removed by the user. MicroSD, in contrast, can be removed
> >> by the user.
> >>
> >> For the internal flash we wanted long intervals and relaxed limits to
> >> gain better performance.
> >>
> >> For MicroSD we wanted very short intervals and tough limits to make sure
> >> that if the user suddenly removes his microSD (users do this all the
> >> time) - we do not lose data.
> >
> > Thinking twice about it, I find that the different requirements for
> > interval flash/external microSD can also be solved by this scheme.
> >
> > Introduce a per-bdi dirty_background_time (and optionally dirty_time)
> > as the counterpart of (and works in parallel to) global dirty[_background]_ratio,
> > however with unit "milliseconds worth of data".
> >
> > The per-bdi dirty_background_time will be set low for external microSD
> > and high for internal flash. Then you get timely writeouts for microSD
> > and reasonably delayed writes for internal flash (controllable by the
> > global dirty_expire_centisecs).
> >
> > The dirty_background_time will actually work more reliable than
> > dirty_expire_centisecs because it will checked immediately after the
> > application dirties more pages. And the dirty_time could provide
> > strong data integrity guarantee -- much stronger than
> > dirty_expire_centisecs -- if used.
> >
> > Does that sound reasonable?
> >
> > Thanks,
> > Fengguang
> >
> 
> My understanding of your email appears that you are agreeing in
> principle that the temporal
> aspect of this problem needs to be addressed along with your spatial
> pattern analysis technique.

Yup.

> I feel a more generic solution to the problem is required because the
> problem faced by Artem can appear
> in a different situation for a different application.
> 
> I can re-implement my original patch in either centiseconds or
> milliseconds as suggested by you.

My concern on your patch is the possible conflicts and confusions
between the global and the per-bdi dirty_expire_centisecs. To maintain
compatibility you need to keep the global one. Then there is the hard
question of "what to do with the per-bdi values when the global value
is changed". Whatever policy you choose, there will be user unexpected
behaviors.

I don't like such conflicting/inconsistent interfaces.

Given that we'll need to introduce the dirty_background_time interface
anyway, and it happen to can address the N900 internal/removable storage
problem (mostly), I'm more than glad to cancel the dirty_expire_centisecs
problem.

Or, do you have better way out of the dirty_expire_centisecs dilemma?

Thanks,
Fengguang

WARNING: multiple messages have this Message-ID (diff)
From: Wu Fengguang <fengguang.wu@intel.com>
To: Kautuk Consul <consul.kautuk@gmail.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>,
	Mel Gorman <mgorman@suse.de>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Jan Kara <jack@suse.cz>, Dave Chinner <david@fromorbit.com>,
	Greg Thelen <gthelen@google.com>
Subject: Re: [PATCH] writeback: Per-block device bdi->dirty_writeback_interval and bdi->dirty_expire_interval.
Date: Fri, 19 Aug 2011 10:34:06 +0800	[thread overview]
Message-ID: <20110819023406.GA12732@localhost> (raw)
In-Reply-To: <CAFPAmTShNRykOEbUfRan_2uAAbBoRHE0RhOh4DrbWKq7a4-Z9Q@mail.gmail.com>

Hi Kautuk,

On Fri, Aug 19, 2011 at 12:25:58AM +0800, Kautuk Consul wrote:
> 
> Lines: 59
> 
> Hi Wu,
> 
> On Thu, Aug 18, 2011 at 6:43 PM, Wu Fengguang <fengguang.wu@intel.com> wrote:
> > Hi Artem,
> >
> >> Here is a real use-case we had when developing the N900 phone. We had
> >> internal flash and external microSD slot. Internal flash is soldered in
> >> and cannot be removed by the user. MicroSD, in contrast, can be removed
> >> by the user.
> >>
> >> For the internal flash we wanted long intervals and relaxed limits to
> >> gain better performance.
> >>
> >> For MicroSD we wanted very short intervals and tough limits to make sure
> >> that if the user suddenly removes his microSD (users do this all the
> >> time) - we do not lose data.
> >
> > Thinking twice about it, I find that the different requirements for
> > interval flash/external microSD can also be solved by this scheme.
> >
> > Introduce a per-bdi dirty_background_time (and optionally dirty_time)
> > as the counterpart of (and works in parallel to) global dirty[_background]_ratio,
> > however with unit "milliseconds worth of data".
> >
> > The per-bdi dirty_background_time will be set low for external microSD
> > and high for internal flash. Then you get timely writeouts for microSD
> > and reasonably delayed writes for internal flash (controllable by the
> > global dirty_expire_centisecs).
> >
> > The dirty_background_time will actually work more reliable than
> > dirty_expire_centisecs because it will checked immediately after the
> > application dirties more pages. And the dirty_time could provide
> > strong data integrity guarantee -- much stronger than
> > dirty_expire_centisecs -- if used.
> >
> > Does that sound reasonable?
> >
> > Thanks,
> > Fengguang
> >
> 
> My understanding of your email appears that you are agreeing in
> principle that the temporal
> aspect of this problem needs to be addressed along with your spatial
> pattern analysis technique.

Yup.

> I feel a more generic solution to the problem is required because the
> problem faced by Artem can appear
> in a different situation for a different application.
> 
> I can re-implement my original patch in either centiseconds or
> milliseconds as suggested by you.

My concern on your patch is the possible conflicts and confusions
between the global and the per-bdi dirty_expire_centisecs. To maintain
compatibility you need to keep the global one. Then there is the hard
question of "what to do with the per-bdi values when the global value
is changed". Whatever policy you choose, there will be user unexpected
behaviors.

I don't like such conflicting/inconsistent interfaces.

Given that we'll need to introduce the dirty_background_time interface
anyway, and it happen to can address the N900 internal/removable storage
problem (mostly), I'm more than glad to cancel the dirty_expire_centisecs
problem.

Or, do you have better way out of the dirty_expire_centisecs dilemma?

Thanks,
Fengguang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2011-08-19  2:34 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 12:20 [PATCH] writeback: Per-block device bdi->dirty_writeback_interval and bdi->dirty_expire_interval Kautuk Consul
2011-08-11 12:20 ` Kautuk Consul
2011-08-18  9:48 ` Wu Fengguang
2011-08-18  9:48   ` Wu Fengguang
2011-08-18  9:51   ` Wu Fengguang
2011-08-18  9:51     ` Wu Fengguang
2011-08-18 11:28   ` Kautuk Consul
2011-08-18 11:28     ` Kautuk Consul
2011-08-18 12:55     ` Wu Fengguang
2011-08-18 12:55       ` Wu Fengguang
2011-08-18 12:14   ` Artem Bityutskiy
2011-08-18 12:14     ` Artem Bityutskiy
2011-08-18 12:35     ` Wu Fengguang
2011-08-18 12:35       ` Wu Fengguang
2011-08-18 15:26       ` Kautuk Consul
2011-08-18 15:26         ` Kautuk Consul
2011-08-19  2:17         ` Wu Fengguang
2011-08-19  2:17           ` Wu Fengguang
2011-08-19  2:17           ` Wu Fengguang
2011-08-18 13:13     ` Wu Fengguang
2011-08-18 13:13       ` Wu Fengguang
2011-08-18 16:25       ` Kautuk Consul
2011-08-18 16:25         ` Kautuk Consul
2011-08-19  2:34         ` Wu Fengguang [this message]
2011-08-19  2:34           ` Wu Fengguang
2011-08-19  4:38           ` Kautuk Consul
2011-08-19  4:38             ` Kautuk Consul
2011-08-19  5:28             ` Wu Fengguang
2011-08-19  5:28               ` Wu Fengguang
2011-08-19  6:08               ` Wu Fengguang
2011-08-19  6:08                 ` Wu Fengguang
2011-08-19  7:00                 ` Kautuk Consul
2011-08-19  7:00                   ` Kautuk Consul
2011-08-19  7:00                   ` Kautuk Consul
2011-08-19 14:24                   ` Wu Fengguang
2011-08-19 14:24                     ` Wu Fengguang
2011-08-19 17:20                     ` Kautuk Consul
2011-08-19 17:20                       ` Kautuk Consul
2011-08-21 14:11                       ` Wu Fengguang
2011-08-21 14:11                         ` Wu Fengguang
2011-08-21 14:11                         ` Wu Fengguang
2011-08-19 11:55       ` Artem Bityutskiy
2011-08-19 11:55         ` Artem Bityutskiy
2011-08-19 14:27         ` Wu Fengguang
2011-08-19 14:27           ` 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=20110819023406.GA12732@localhost \
    --to=fengguang.wu@intel.com \
    --cc=consul.kautuk@gmail.com \
    --cc=david@fromorbit.com \
    --cc=dedekind1@gmail.com \
    --cc=gthelen@google.com \
    --cc=jack@suse.cz \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    /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.