Re: [PATCH V3] powerpc/mm: Fix Multi hit ERAT cause by recent THP update
From: Balbir Singh <bsingharora@gmail.com>
Date: 2016-02-16 05:20:27
Also in:
linuxppc-dev, lkml
On Mon, 2016-02-15 at 16:31 +0530, Aneesh Kumar K.V wrote:
Balbir Singh [off-list ref] writes:quoted
quoted
Now we can't depend for mm_cpumask, a parallel find_linux_pte_hugepte can happen outside that. Now i had a variant for kick_all_cpus_sync that ignored idle cpus. But then that needs more verification. http://article.gmane.org/gmane.linux.ports.ppc.embedded/81105Can be racy as a CPU moves from non-idle to idle Inquoted
+A A A A A pmd_hugepage_update(vma->vm_mm, address, pmdp, ~0UL, 0); +A A A A A /* +A A A A A A * This ensures that generic code that rely on IRQ disabling +A A A A A A * to prevent a parallel THP split work as expected. +A A A A A A */ +A A A A A kick_all_cpus_sync();pmdp_invalidate()->pmd_hugepage_update() can still run in parallel withA find_linux_pte_or_hugepte() and race.. Am I missing something?Yes. But then we make sure that the pte_t returned by find_linux_pte_or_hugepte doesn't change to a regular pmd entry by using that kick. Now callers of find_lnux_pte_or_hugepte will check for _PAGE_PRESENT. So if it called before pmd_hugepage_update(_PAGE_PRESENT), we wait for the caller to finish the usage (via kick()). Or they bail out after finding _PAGE_PRESENT cleared.
Makes sense, but I would still check the assumption about checking for _PAGE_PRESENT Balbir Singh -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>