Re: RFC - how to balance Dirty+Writeback in the face of slow writeback.

From: Neil Brown
Date: Sun Aug 20 2006 - 20:33:19 EST

On August 18, ak@xxxxxxx wrote:
> Jens Axboe <axboe@xxxxxxx> writes:
> > On Thu, Aug 17 2006, Andrew Morton wrote:
> > > It seems that the many-writers-to-different-disks workloads don't happen
> > > very often. We know this because
> > >
> > > a) The 2.4 performance is utterly awful, and I never saw anybody
> > > complain and
> >
> > Talk to some of the people that used DVD-RAM devices (or other
> > excruciatingly slow writers) on their system, and they would disagree
> > violently :-)
> I hit this recently while doing backups to a slow external USB disk.
> The system was quite unusable (some commands blocked for over a minute)

I suspect we are going to see more of this, as USB drive for backups
is probably a very attractive option for many.

The 'obvious' solution would be to count dirty pages per backing_dev
and rate limit writes based on this.
But counting pages can be expensive. I wonder if there might be some
way to throttle the required writes without doing too much counting.

Could we watch when the backing_dev is congested and use that?
When Dirty+Writeback is between max_dirty/2 and max_dirty,
balance_dirty_pages waits until mapping->backing_dev_info
is not congested.

That might slow things down, but it is hard to know if it would slow
things down the right amount...

Given that large machines are likely to have lots of different
backing_devs, maybe counting all the dirty pages per backing_dev
wouldn't be too expensive?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at