Re: 2.5.73-mm2

Nikita Danilov
2003-07-01T12:39:33Z

William Lee Irwin III writes:
> On Tue, 1 Jul 2003, William Lee Irwin III wrote:
> >> Well, I was mostly looking for getting handed back 0 when lowmem is
> >> empty; I actually did realize they didn't give entirely accurate counts
> >> of free lowmem pages.
>
> On Tue, Jul 01, 2003 at 12:08:03PM +0100, Hugh Dickins wrote:
> > I'm not pleading for complete accuracy, but nr_free_buffer_pages()
> > will never hand back 0 (if your system managed to boot).
> > It's a static count of present_pages (adjusted), not of
> > free pages. Or am I misreading nr_free_zone_pages()?
>
> You're right. Wow, that's even more worse than I suspected.
>

Another thing is that if one boots with mem=X, nr_free_pagecache_pages()
returns X. However part of X (occupied by kernel image, etc) is not part
of any zone. As a result, zone actually contains fewer pages than
reported by nr_free_pagecache_pages(). With X small enough (comparable
with kernel image size, for example) this can confuse
balance_dirty_pages() enough so that throttling would never start, and
VM will oom_kill().

>
> -- wli

Nikita.