Re: [PATCH v5 7/9] mm/mremap: Move TLB flush outside page table lock

From
Aneesh Kumar K.V <hidden>
Date
2021-05-24 14:24:28
Also in
linuxppc-dev
Reply to
Linus Torvalds, 2021-05-21
Linus Torvalds [off-list ref] writes:
On Fri, May 21, 2021 at 3:04 AM Aneesh Kumar K.V
[off-list ref] wrote:
quoted
We could do MOVE_PMD with something like below? A equivalent MOVE_PUD
will be costlier which makes me wonder whether we should even support that?
Well, without USE_SPLIT_PTE_PTLOCKS the pud case would be trivial too.
But everybody uses split pte locks in practice.

I get the feeling that the rmap code might have to use
pud_lock/pmd_lock. I wonder how painful that would be.
Looking at this further, i guess we need to do the above to close the
race window. We do

static bool map_pte(struct page_vma_mapped_walk *pvmw)
{
	pvmw->pte = pte_offset_map(pvmw->pmd, pvmw->address);
        ..
	pvmw->ptl = pte_lockptr(pvmw->vma->vm_mm, pvmw->pmd);
	spin_lock(pvmw->ptl);
}

That is we walk the table without holding the pte ptl. Hence we still
can race with the optimized PMD move.

-aneesh


Thread (55 messages) 55 messages, 11 authors, last reply 2021-05-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help