powerpc/mm: Make sure a local_irq_disable prevent a parallel THP split
Subsystems (2)
PATCH 1/1 powerpc/mm: Make sure a local_irq_disable prevent a parallel THP split
From: "Aneesh Kumar K.V" <[email protected]>
We have generic code like the one in get_futex_key that assume that a local_irq_disable prevents a parallel THP split. Support that by adding a dummy smp call function after setting _PAGE_SPLITTING. Code paths like get_user_pages_fast still need to check for _PAGE_SPLITTING after disabling IRQ which indicate that a parallel THP splitting is ongoing. Now if they don't find _PAGE_SPLITTING set, then we can be sure that parallel split will now block in pmdp_splitting flush until we enables IRQ
--- arch/powerpc/mm/pgtable_64.c | 5 +++++ 1 file changed, 5 insertions(+)
arch/powerpc/mm/pgtable_64.c +5 -0
@@ -647,6 +647,11 @@ void pmdp_splitting_flush(struct vm_area_struct *vma,if (old & _PAGE_HASHPTE)hpte_do_hugepage_flush (vma->vm_mm, address, pmdp); } +/* +* This ensures that generic code that rely on IRQ disabling +* to prevent a parallel THP split work as expected. +*/ +kick_all_cpus_sync (); }/*
Signature · 7 lines
1.8.3.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 11 lines · Aneesh Kumar K.V
From: "Aneesh Kumar K.V" <[email protected]>
We have generic code like the one in
get_futex_keythat assume that alocal_irq_disableprevents a parallel THP split. Support that by adding a dummy smp call function after setting_PAGE_SPLITTING. Code paths likeget_user_pages_faststill need to check for_PAGE_SPLITTINGafter disabling IRQ which indicate that a parallel THP splitting is ongoing. Now if they don't find_PAGE_SPLITTINGset, then we can be sure that parallel split will now block inpmdp_splittingflush until we enables IRQ
Quoted 1 line
Signed-off-by Aneesh Kumar K.V <[email protected]>
Signature · 7 lines
All rights reversed -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>