> > > Which can only happen when it is larger than 10% of dirty_thresh.
Yeah, I guess the point of the function was to limit nr_write to
_anything_ smaller than the total memory.
I guess you will have some request queue with limited length, no?
The main problem seems to be if devices use up all the reserved memory
for queuing write requests. Limiting the in-flight pages is a very
crude way to solve this, the assumptions are:
O: overhead as a fraction of the request size
T: total memory
R: reserved memory
T-R: may be full of anon pages
so if (T-R)*O > R we are in trouble.
if we limit the writeback memory to L and L*O < R we are OK. But we
don't know O (it's device dependent). We can make an estimate
calculate L based on that, but that will be a number totally
independent of the dirty threshold.
For per-bdi limits we have the queue length.
Miklod
-