Re: [PATCH] x86: enable RCU based table free when PARAVIRT
From: Linus Torvalds
Date: Wed Aug 23 2017 - 16:27:25 EST
On Wed, Aug 23, 2017 at 12:59 PM, Kirill A. Shutemov
<kirill@xxxxxxxxxxxxx> wrote:
>
> In this case we need performance numbers for !PARAVIRT kernel.
Yes.
> Numbers for tight loop of "mmap(MAP_POPULATE); munmap()" might be
> interesting too for worst case scenario.
Actually, I don't think you want to populate all the pages. You just
want to populate *one* page, in order to build up the page directory
structure, not allocate all the final points.
And we only free the actual page tables when there is nothing around,
so it should be at least a 2MB-aligned region etc.
So you should do a *big* allocation, and then touch a single page in
the middle, and then minmap it - that should give you maximal page
table activity. Otherwise the page tables will generally just stay
around.
Realistically, it's mainly exit() that frees page tables. Yes, you may
have a few page tables free'd by a normal munmap(), but it's usually
very limited. Which is why I suggested that script-heavy thing with
lots of small executables. That tends to be the main realistic load
that really causes a ton of page directory activity.
Linus