Re: [PATCH] Hugepages should be accounted as unevictable pages.

Alok Kataria
2009-06-23T22:06:58Z

On Tue, 2009-06-23 at 14:55 -0700, Rik van Riel wrote:
> Alok Kataria wrote:
> > On Tue, 2009-06-23 at 14:24 -0700, Rik van Riel wrote:
>
> >> I can see something reasonable on both sides of this
> >> particular debate. However, even with this patch the
> >> "unevictable" statistic does not reclaim the total
> >> number of pages that are unevictable pages from a
> >> zone, so I am not sure how it helps you achieve your
> >> goal.
> >
> > Yes but most of the other memory (page table and others) which is
> > unevictable is actually static in nature. IOW, the amount of this other
> > kind of kernel unevictable pages can be actually interpolated from the
> > amount of physical memory on the system.
>
> That would be a fair argument, if it were true.
>
> Things like page tables and dentry/inode caches vary
> according to the use case and are allocated as needed.
> They are in no way "static in nature".
>

Maybe static was the wrong word to use here.
What i meant was that you could always calculate the *maximum* amount of
memory that is going to be used by page table and can also determine the
% of memory that will be used by slab caches.
So that ways you should be statically able to tell that no more than 'X'
amount of memory is going to be locked here.
Will again like to stress that "X" is not the exact amount that is
locked here but the one which can be.

OTOH, for hugepages and mlocked pages you need to read the exact counts
as this can change according to user selection.

Thanks,
Alok