Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
> > No, we _start_ writeback for 1.5*ratelimit_pages pages, but do not > > wait for those writebacks to finish. > > > > So for a slow device and a fast writer, dirty+writeback can indeed > > increase beyond the dirty threshold. > > > > Nope, try it. > > If a process dirties 1000 pages it'll

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Andrew Morton
On Tue, 24 Apr 2007 13:22:02 +0200 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > On Tue, 24 Apr 2007 12:12:18 +0200 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > > > > > On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: > > > > On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi <[EMAIL

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
> On Tue, 24 Apr 2007 12:12:18 +0200 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > > > On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: > > > On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi <[EMAIL PROTECTED]> > > > wrote: > > > > > > > > Ahh, now I see; I had totally blocked out these

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Andrew Morton
On Tue, 24 Apr 2007 12:12:18 +0200 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: > > On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > > > > > Ahh, now I see; I had totally blocked out these few lines: > > > >

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 12:19 +0200, Miklos Szeredi wrote: > > > > > Ahh, now I see; I had totally blocked out these few lines: > > > > > > > > > > pages_written += write_chunk - wbc.nr_to_write; > > > > > if (pages_written >= write_chunk) > > > > >

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
> > > > Ahh, now I see; I had totally blocked out these few lines: > > > > > > > > pages_written += write_chunk - wbc.nr_to_write; > > > > if (pages_written >= write_chunk) > > > > break; /* We've done our

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: > On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > > > Ahh, now I see; I had totally blocked out these few lines: > > > > > > pages_written += write_chunk - wbc.nr_to_write; > > >

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Andrew Morton
On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > Ahh, now I see; I had totally blocked out these few lines: > > > > pages_written += write_chunk - wbc.nr_to_write; > > if (pages_written >= write_chunk) > >

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
> Ahh, now I see; I had totally blocked out these few lines: > > pages_written += write_chunk - wbc.nr_to_write; > if (pages_written >= write_chunk) > break; /* We've done our duty */ > > yeah, those look dubious

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 11:14 +0200, Miklos Szeredi wrote: > > > I'm still not quite sure what purpose the above "soft" limiting > > > serves. It seems to just give advantage to writers, which managed to > > > accumulate lots of dirty pages, and then can convert that into even > > > more

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
> > > > This is probably a > > > > reasonable thing to do but it doesn't feel like the right place. I > > > > think get_dirty_limits should return the raw threshold, and > > > > balance_dirty_pages should do both tests - the bdi-local test and the > > > > system-wide test. > > > > > > Ok,

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 10:19 +0200, Miklos Szeredi wrote: > > > This is probably a > > > reasonable thing to do but it doesn't feel like the right place. I > > > think get_dirty_limits should return the raw threshold, and > > > balance_dirty_pages should do both tests - the bdi-local test and

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
> > This is probably a > > reasonable thing to do but it doesn't feel like the right place. I > > think get_dirty_limits should return the raw threshold, and > > balance_dirty_pages should do both tests - the bdi-local test and the > > system-wide test. > > Ok, that makes sense I guess.

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 12:58 +1000, Neil Brown wrote: > On Friday April 20, [EMAIL PROTECTED] wrote: > > Scale writeback cache per backing device, proportional to its writeout > > speed. > > So it works like this: > > We account for writeout in full pages. > When a page has the Writeback flag

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 12:58 +1000, Neil Brown wrote: On Friday April 20, [EMAIL PROTECTED] wrote: Scale writeback cache per backing device, proportional to its writeout speed. So it works like this: We account for writeout in full pages. When a page has the Writeback flag cleared,

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
This is probably a reasonable thing to do but it doesn't feel like the right place. I think get_dirty_limits should return the raw threshold, and balance_dirty_pages should do both tests - the bdi-local test and the system-wide test. Ok, that makes sense I guess. Well, my narrow

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 10:19 +0200, Miklos Szeredi wrote: This is probably a reasonable thing to do but it doesn't feel like the right place. I think get_dirty_limits should return the raw threshold, and balance_dirty_pages should do both tests - the bdi-local test and the

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
This is probably a reasonable thing to do but it doesn't feel like the right place. I think get_dirty_limits should return the raw threshold, and balance_dirty_pages should do both tests - the bdi-local test and the system-wide test. Ok, that makes sense I guess.

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 11:14 +0200, Miklos Szeredi wrote: I'm still not quite sure what purpose the above soft limiting serves. It seems to just give advantage to writers, which managed to accumulate lots of dirty pages, and then can convert that into even more dirtyings. The

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
Ahh, now I see; I had totally blocked out these few lines: pages_written += write_chunk - wbc.nr_to_write; if (pages_written = write_chunk) break; /* We've done our duty */ yeah, those look dubious

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Andrew Morton
On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote: Ahh, now I see; I had totally blocked out these few lines: pages_written += write_chunk - wbc.nr_to_write; if (pages_written = write_chunk)

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote: Ahh, now I see; I had totally blocked out these few lines: pages_written += write_chunk - wbc.nr_to_write; if

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
Ahh, now I see; I had totally blocked out these few lines: pages_written += write_chunk - wbc.nr_to_write; if (pages_written = write_chunk) break; /* We've done our duty */

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Peter Zijlstra
On Tue, 2007-04-24 at 12:19 +0200, Miklos Szeredi wrote: Ahh, now I see; I had totally blocked out these few lines: pages_written += write_chunk - wbc.nr_to_write; if (pages_written = write_chunk)

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Andrew Morton
On Tue, 24 Apr 2007 12:12:18 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote: Ahh, now I see; I had totally blocked out these few lines:

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
On Tue, 24 Apr 2007 12:12:18 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote: Ahh, now I see; I had totally blocked out these few lines:

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Andrew Morton
On Tue, 24 Apr 2007 13:22:02 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote: On Tue, 24 Apr 2007 12:12:18 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: On Tue, 2007-04-24 at 03:00 -0700, Andrew Morton wrote: On Tue, 24 Apr 2007 11:47:20 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote:

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-24 Thread Miklos Szeredi
No, we _start_ writeback for 1.5*ratelimit_pages pages, but do not wait for those writebacks to finish. So for a slow device and a fast writer, dirty+writeback can indeed increase beyond the dirty threshold. Nope, try it. If a process dirties 1000 pages it'll then go into

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Neil Brown
On Friday April 20, [EMAIL PROTECTED] wrote: > Scale writeback cache per backing device, proportional to its writeout speed. So it works like this: We account for writeout in full pages. When a page has the Writeback flag cleared, we account that as a successfully retired write for the

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Christoph Lameter
On Mon, 23 Apr 2007, Peter Zijlstra wrote: > Ooh, thats handy... /me ditches the hotplug code again. > That is, unless its very common to have half empty boxens.. ? Its up to the arch code to establish reasonable boundaries. - To unsubscribe from this list: send the line "unsubscribe

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Peter Zijlstra
On Mon, 2007-04-23 at 08:48 -0700, Christoph Lameter wrote: > On Sat, 21 Apr 2007, Peter Zijlstra wrote: > > > > > This is enormously wrong for CONFIG_NR_CPUS=1024 on a 2-way. > > > > Right, I knew about that but, uhm. > > > > I wanted to make that num_online_cpus(), and install a hotplug

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Christoph Lameter
On Sat, 21 Apr 2007, Peter Zijlstra wrote: > > > This is enormously wrong for CONFIG_NR_CPUS=1024 on a 2-way. > > Right, I knew about that but, uhm. > > I wanted to make that num_online_cpus(), and install a hotplug notifier > to fold the percpu delta back into the total on cpu offline. Use

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Andrew Morton
On Mon, 23 Apr 2007 08:29:59 +0200 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > > > What about swapout? That can increase the number of writeback pages, > > > without decreasing the number of dirty pages, no? > > > > Could we not solve that by enabling cap_account_writeback on > > swapper_space,

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Miklos Szeredi
> > > > The other deadlock, in throttle_vm_writeout() is still to be solved. > > > > > > Let's go back to the original changelog: > > > > > > Author: marcelo.tosatti > > > Date: Tue Mar 8 17:25:19 2005 + > > > > > > [PATCH] vm: pageout throttling > > > > > > With silly

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Peter Zijlstra
On Sat, 2007-04-21 at 22:25 +0200, Miklos Szeredi wrote: > > > The other deadlock, in throttle_vm_writeout() is still to be solved. > > > > Let's go back to the original changelog: > > > > Author: marcelo.tosatti > > Date: Tue Mar 8 17:25:19 2005 + > > > > [PATCH] vm: pageout

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Peter Zijlstra
On Sat, 2007-04-21 at 22:25 +0200, Miklos Szeredi wrote: The other deadlock, in throttle_vm_writeout() is still to be solved. Let's go back to the original changelog: Author: marcelo.tosatti marcelo.tosatti Date: Tue Mar 8 17:25:19 2005 + [PATCH] vm: pageout

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Miklos Szeredi
The other deadlock, in throttle_vm_writeout() is still to be solved. Let's go back to the original changelog: Author: marcelo.tosatti marcelo.tosatti Date: Tue Mar 8 17:25:19 2005 + [PATCH] vm: pageout throttling With silly pageout testcases it

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Andrew Morton
On Mon, 23 Apr 2007 08:29:59 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote: What about swapout? That can increase the number of writeback pages, without decreasing the number of dirty pages, no? Could we not solve that by enabling cap_account_writeback on swapper_space, and thereby

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Christoph Lameter
On Sat, 21 Apr 2007, Peter Zijlstra wrote: This is enormously wrong for CONFIG_NR_CPUS=1024 on a 2-way. Right, I knew about that but, uhm. I wanted to make that num_online_cpus(), and install a hotplug notifier to fold the percpu delta back into the total on cpu offline. Use nr_cpu_ids

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Peter Zijlstra
On Mon, 2007-04-23 at 08:48 -0700, Christoph Lameter wrote: On Sat, 21 Apr 2007, Peter Zijlstra wrote: This is enormously wrong for CONFIG_NR_CPUS=1024 on a 2-way. Right, I knew about that but, uhm. I wanted to make that num_online_cpus(), and install a hotplug notifier to fold

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Christoph Lameter
On Mon, 23 Apr 2007, Peter Zijlstra wrote: Ooh, thats handy... /me ditches the hotplug code again. That is, unless its very common to have half empty boxens.. ? Its up to the arch code to establish reasonable boundaries. - To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-23 Thread Neil Brown
On Friday April 20, [EMAIL PROTECTED] wrote: Scale writeback cache per backing device, proportional to its writeout speed. So it works like this: We account for writeout in full pages. When a page has the Writeback flag cleared, we account that as a successfully retired write for the

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-22 Thread Andrew Morton
On Sat, 21 Apr 2007 14:01:36 +0200 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > On Sat, 2007-04-21 at 02:55 -0700, Andrew Morton wrote: > > > > + > > > + __mod_bdi_stat64(bdi, BDI_WRITEOUT, -half); > > > + bdi->cycles += cycle; > > > + } > > > + bdi->cycles = global_cycle; > > > +

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-22 Thread Andrew Morton
On Sat, 21 Apr 2007 14:01:36 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: On Sat, 2007-04-21 at 02:55 -0700, Andrew Morton wrote: + + __mod_bdi_stat64(bdi, BDI_WRITEOUT, -half); + bdi-cycles += cycle; + } + bdi-cycles = global_cycle; +

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Miklos Szeredi
> > The other deadlock, in throttle_vm_writeout() is still to be solved. > > Let's go back to the original changelog: > > Author: marcelo.tosatti > Date: Tue Mar 8 17:25:19 2005 + > > [PATCH] vm: pageout throttling > > With silly pageout testcases it is possible to place

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Peter Zijlstra
On Sat, 2007-04-21 at 14:15 +0200, Peter Zijlstra wrote: > > > > +/* > > > > + * maximal error of a stat counter. > > > > + */ > > > > +static inline unsigned long bdi_stat_delta(void) > > > > +{ > > > > +#ifdef CONFIG_SMP > > > > + return NR_CPUS * FBC_BATCH; > > > > > > This is enormously

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Peter Zijlstra
> > > +/* > > > + * maximal error of a stat counter. > > > + */ > > > +static inline unsigned long bdi_stat_delta(void) > > > +{ > > > +#ifdef CONFIG_SMP > > > + return NR_CPUS * FBC_BATCH; > > > > This is enormously wrong for CONFIG_NR_CPUS=1024 on a 2-way. Right, I knew about that but, uhm.

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Peter Zijlstra
On Sat, 2007-04-21 at 02:55 -0700, Andrew Morton wrote: > On Fri, 20 Apr 2007 17:52:04 +0200 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > > > Scale writeback cache per backing device, proportional to its writeout > > speed. > > > > By decoupling the BDI dirty thresholds a number of problems we

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Andrew Morton
On Sat, 21 Apr 2007 12:38:45 +0200 Miklos Szeredi <[EMAIL PROTECTED]> wrote: > The other deadlock, in throttle_vm_writeout() is still to be solved. Let's go back to the original changelog: Author: marcelo.tosatti Date: Tue Mar 8 17:25:19 2005 + [PATCH] vm: pageout throttling

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Miklos Szeredi
> On Fri, 20 Apr 2007 17:52:04 +0200 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > > > Scale writeback cache per backing device, proportional to its writeout > > speed. > > > > By decoupling the BDI dirty thresholds a number of problems we currently > > have > > will go away, namely: > > > > -

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Andrew Morton
On Fri, 20 Apr 2007 17:52:04 +0200 Peter Zijlstra <[EMAIL PROTECTED]> wrote: > Scale writeback cache per backing device, proportional to its writeout speed. > > By decoupling the BDI dirty thresholds a number of problems we currently have > will go away, namely: > > - mutual interference

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Andrew Morton
On Fri, 20 Apr 2007 17:52:04 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: Scale writeback cache per backing device, proportional to its writeout speed. By decoupling the BDI dirty thresholds a number of problems we currently have will go away, namely: - mutual interference starvation

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Miklos Szeredi
On Fri, 20 Apr 2007 17:52:04 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: Scale writeback cache per backing device, proportional to its writeout speed. By decoupling the BDI dirty thresholds a number of problems we currently have will go away, namely: - mutual interference

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Andrew Morton
On Sat, 21 Apr 2007 12:38:45 +0200 Miklos Szeredi [EMAIL PROTECTED] wrote: The other deadlock, in throttle_vm_writeout() is still to be solved. Let's go back to the original changelog: Author: marcelo.tosatti marcelo.tosatti Date: Tue Mar 8 17:25:19 2005 + [PATCH] vm: pageout

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Peter Zijlstra
On Sat, 2007-04-21 at 02:55 -0700, Andrew Morton wrote: On Fri, 20 Apr 2007 17:52:04 +0200 Peter Zijlstra [EMAIL PROTECTED] wrote: Scale writeback cache per backing device, proportional to its writeout speed. By decoupling the BDI dirty thresholds a number of problems we currently

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Peter Zijlstra
+/* + * maximal error of a stat counter. + */ +static inline unsigned long bdi_stat_delta(void) +{ +#ifdef CONFIG_SMP + return NR_CPUS * FBC_BATCH; This is enormously wrong for CONFIG_NR_CPUS=1024 on a 2-way. Right, I knew about that but, uhm. I wanted to make that

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Peter Zijlstra
On Sat, 2007-04-21 at 14:15 +0200, Peter Zijlstra wrote: +/* + * maximal error of a stat counter. + */ +static inline unsigned long bdi_stat_delta(void) +{ +#ifdef CONFIG_SMP + return NR_CPUS * FBC_BATCH; This is enormously wrong for CONFIG_NR_CPUS=1024 on

Re: [PATCH 10/10] mm: per device dirty threshold

2007-04-21 Thread Miklos Szeredi
The other deadlock, in throttle_vm_writeout() is still to be solved. Let's go back to the original changelog: Author: marcelo.tosatti marcelo.tosatti Date: Tue Mar 8 17:25:19 2005 + [PATCH] vm: pageout throttling With silly pageout testcases it is possible to place

[PATCH 10/10] mm: per device dirty threshold

2007-04-20 Thread Peter Zijlstra
Scale writeback cache per backing device, proportional to its writeout speed. By decoupling the BDI dirty thresholds a number of problems we currently have will go away, namely: - mutual interference starvation (for any number of BDIs); - deadlocks with stacked BDIs (loop, FUSE and local NFS

[PATCH 10/10] mm: per device dirty threshold

2007-04-20 Thread Peter Zijlstra
Scale writeback cache per backing device, proportional to its writeout speed. By decoupling the BDI dirty thresholds a number of problems we currently have will go away, namely: - mutual interference starvation (for any number of BDIs); - deadlocks with stacked BDIs (loop, FUSE and local NFS