Re: [PATCH v4 4/7] x86/tlb: fall back to flush all when meet a THPlarge page

From: Borislav Petkov
Date: Thu May 10 2012 - 06:41:09 EST


On Thu, May 10, 2012 at 11:29:05AM +0200, Peter Zijlstra wrote:
> On Thu, 2012-05-10 at 13:00 +0800, Alex Shi wrote:
> > We don't need to flush large pages by PAGE_SIZE step, that just waste
> > time. and actually, large page don't need 'invlpg' optimizing according
> > to our macro benchmark. So, just flush whole TLB is enough for them.
> >
> > The following result is tested on a 2CPU * 4cores * 2HT NHM EP machine,
> > with THP 'always' setting.
>
> What does it do when you disable THP? That has_large_page() thing is a
> massive amount of pointer chasing..

Yeah, this looks like a bit of a overhead. Don't we have some per-mm
accounting of whether that mm struct has hugepages in mm/huge_memory.c,
i.e. something like what collapse_huge_page() does, for example, at the
end by incrementing khugepaged_pages_collapsed but in a per-mm variable?

And make this part of the THP code so we get it for free here.

Is Andrea on the CC list... hm, no, CCed.

Andrea?

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/