-
Andrew Morton authored
The ratelimiting logic in balance_dirty_pages_ratelimited() is designed to prevent excessive calls to the expensive get_page_state(): On a big machine we only check to see if we're over dirty memory limits once per 1024 dirtyings per cpu. This works OK normally, but it has the effect of allowing each process to go 1024 pages over the dirty limit before it gets throttled. So if someone runs 16000 tiobench threads, they can go 16G over the dirty memory threshold and die the death of buffer_head consumption. Because page dirtiness pins the page's buffer_heads, defeating the special buffer_head reclaim logic. I'd left this overshoot artifact in place because it provides a degree of adaptivity - of someone if running hundreds of dirtying processes (dbench!) then they do want to overshoot the dirty memory limit. But it's hard to balance, and is really not worth the futzing around. So change the logic to only perform the get_page_state() call rate limiting if we're known to be under the dirty memory threshold.
3669e824