Messages in this thread | | | Date | Tue, 10 Nov 2009 10:08:58 +0800 | From | Wu Fengguang <> | Subject | Re: Likley stupid question on "throttle_vm_writeout" |
| |
On Mon, Nov 09, 2009 at 04:26:33PM +0100, Peter Zijlstra wrote: > On Mon, 2009-11-09 at 07:15 -0800, Martin Knoblauch wrote: > > Hi, (please CC me on replies) > > > > I have a likely stupid question on the function "throttle_vm_writeout". Looking at the code I find: > > > > if (global_page_state(NR_UNSTABLE_NFS) + > > global_page_state(NR_WRITEBACK) <= dirty_thresh) > > break; > > congestion_wait(WRITE, HZ/10); > > > > Shouldn't the NR_FILE_DIRTY pages be considered as well? > > Ha, you just trod onto a piece of ugly I'd totally forgotten about ;-) > > The intent of throttle_vm_writeout() is to limit the total pages in > writeout and to wait for them to go-away.
Like this:
vmscan fast => large NR_WRITEBACK => throttle vmscan based on it
> Everybody hates the function, nobody managed to actually come up with > anything better.
btw, here is another reason to limit NR_WRITEBACK: I saw many throttle_vm_writeout() waits if there is no wait queue to limit NR_WRITEBACK (eg. NFS). In that case the (steadily) big NR_WRITEBACK is _not_ caused by fast vmscan..
Thanks, Fengguang
| |