Thread (8 messages) flat view 8 messages, 3 authors, 2016-02-16

Re: [PATCH V3] powerpc/mm: Fix Multi hit ERAT cause by recent THP update

From: Aneesh Kumar K.V <hidden>
Date: 2016-02-15 11:02:18
Also in: linux-mm, lkml

Balbir Singh [off-list ref] writes:
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.
=20
http://article.gmane.org/gmane.linux.ports.ppc.embedded/81105
Can be racy as a CPU moves from non-idle to idle

In
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pmd_hugepage_update(vma->vm_mm, address, =
pmdp, ~0UL, 0);
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/*
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* This ensures that generic code th=
at rely on IRQ disabling
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* to prevent a parallel THP split w=
ork as expected.
quoted
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0*/
+=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0kick_all_cpus_sync();
pmdp_invalidate()->pmd_hugepage_update() can still run in parallel with=
=C2=A0
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.

-aneesh
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help