[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4FAE1808.1080504@intel.com>
Date: Sat, 12 May 2012 15:58:00 +0800
From: Alex Shi <alex.shi@...el.com>
To: Andrea Arcangeli <aarcange@...hat.com>
CC: rob@...dley.net, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, arnd@...db.de, rostedt@...dmis.org,
fweisbec@...il.com, jeremy@...p.org, gregkh@...uxfoundation.org,
borislav.petkov@....com, riel@...hat.com, luto@....edu,
avi@...hat.com, len.brown@...el.com, dhowells@...hat.com,
fenghua.yu@...el.com, ak@...ux.intel.com, cpw@....com,
steiner@....com, akpm@...ux-foundation.org, penberg@...nel.org,
hughd@...gle.com, rientjes@...gle.com,
kosaki.motohiro@...fujitsu.com, n-horiguchi@...jp.nec.com,
paul.gortmaker@...driver.com, trenn@...e.de, tj@...nel.org,
oleg@...hat.com, axboe@...nel.dk, a.p.zijlstra@...llo.nl,
kamezawa.hiroyu@...fujitsu.com, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 4/7] x86/tlb: fall back to flush all when meet a THP
large page
On 05/12/2012 12:28 AM, Andrea Arcangeli wrote:
> Hi,
>
> On Thu, May 10, 2012 at 01:00:10PM +0800, Alex Shi wrote:
>> + for (addr = start; addr <= end; addr += HPAGE_SIZE) {
>> + pgd = pgd_offset(mm, addr);
>> + if (likely(!pgd_none(*pgd))) {
>> + pud = pud_offset(pgd, addr);
>> + if (likely(!pud_none(*pud))) {
>> + pmd = pmd_offset(pud, addr);
>> + if (likely(!pmd_none(*pmd)))
>> + if (pmd_large(*pmd))
>> + return 1;
>
> Note with THP we've to set the pmd temporarily not present during
> split_huge_page just before it returns a regular pmd (to avoid erratas
> and mixing 4k and 2m tlb on the same physical page). So pmd_large
> would fail in that small time window and we would do the invlpg loop
> (which should still work safe so no big deal). But I believe you could
> use pmd_trans_huge above, maybe gcc can drop the whole block with
> CONFIG_TRANSPARENT_HUGEPAGE=n.
Thanks the explanation.
Sure, if THP was not enabled, we can return 0 directly. :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists