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

Neil Brown
2006-08-25T04:36:27Z

On Monday August 21, axboe@suse.de wrote:
>
> But these numbers are in no way tied to the hardware. It may be totally
> reasonable to have 3GiB of dirty data on one system, and it may be
> totally unreasonable to have 96MiB of dirty data on another. I've always
> thought that assuming any kind of reliable throttling at the queue level
> is broken and that the vm should handle this completely.

I keep changing my mind about this. Sometimes I see it that way,
sometimes it seems very sensible for throttling to happen at the
device queue.

Can I ask a question: Why do we have a 'nr_requests' maximum? Why
not just allocate request structures whenever a request is made?
If there some reason relating to making the block layer work more
efficiently? or is it just because the VM requires it.

I'm beginning to think that the current scheme really works very well
- except for a few 'bugs'(*).
The one change that might make sense would be for the VM to be able to
tune the queue size of each backing dev. Exactly how that would work
I'm not sure, but the goal would be to get the sum of the active queue
sizes to about 1 half of dirty_threshold.

The 'bugs' I am currently aware of are:
- nfs doesn't put a limit on the request queue
- the ext3 journal often writes out dirty data without clearing
the Dirty flag on the page - so the nr_dirty count ends up wrong.
ext3 writes the buffers out and marks them clean. So when
the VM tried to flush a page, it finds all the buffers are clean
and so marks the page clean, so the nr_dirty count eventually
gets correct again, but I think this can cause write throttling to
be very unfair at times.

I think we need a queue limit on NFS requests.....

NeilBrown