Messages in this thread | | | Date | Fri, 25 Oct 2013 23:37:42 +0100 | From | Fengguang Wu <> | Subject | Re: Disabling in-memory write cache for x86-64 in Linux II |
| |
On Fri, Oct 25, 2013 at 02:29:37AM -0700, Andrew Morton wrote: > On Fri, 25 Oct 2013 05:18:42 -0400 "Theodore Ts'o" <tytso@mit.edu> wrote: > > > What I think would make sense is to dynamically measure the speed of > > writeback, so that we can set these limits as a function of the device > > speed. > > We attempt to do this now - have a look through struct backing_dev_info.
To be exact, it's backing_dev_info.write_bandwidth which is estimated in bdi_update_write_bandwidth() and exported as "BdiWriteBandwidth" in debugfs file bdi.stats.
> Apparently all this stuff isn't working as desired (and perhaps as designed) > in this case. Will take a look after a return to normalcy ;)
Right. The write bandwidth estimation is only estimated and used when background dirty threshold is reached and hence the disk is actively doing writeback IO -- which is the case that we can do reasonable estimation of the writeback bandwidth.
Note that this estimated BdiWriteBandwidth may better be named "writeback" bandwidth because it may change depending on the workload at the time -- eg. sequential vs. random writes; whether there are parallel reads or direct IO competing the disk time.
BdiWriteBandwidth is only designed for use by the dirty throttling logic and is not generally useful/reliable for other purposes.
It's a bit late and I'd like to carry the original question as exercises in tomorrow's airplanes. :)
Thanks, Fengguang
| |