On Mon, May 24, 2021 at 10:44 PM A lneesh Kumar K.V
wrote:
>
> Should we worry about the below race. The window would be small
>
> CPU 1 CPU 2 CPU 3
>
> mremap(old_addr, new_addr) page_shrinker/try_to_unmap_one
>
>
Linus Torvalds writes:
> On Mon, May 24, 2021 at 3:38 AM Aneesh Kumar K.V
> wrote:
>>
>> Avoid the above race with MOVE_PMD by holding pte ptl in mremap and waiting
>> for
>> parallel pagetable walk to finish operating on pte before updating new_pmd
>
> Ack on the concept.
Should we worry
On Mon, May 24, 2021 at 3:38 AM Aneesh Kumar K.V
wrote:
>
> Avoid the above race with MOVE_PMD by holding pte ptl in mremap and waiting
> for
> parallel pagetable walk to finish operating on pte before updating new_pmd
Ack on the concept.
However, not so much on the patch.
Odd whitespace
CPU 1 CPU 2 CPU 3
mremap(old_addr, new_addr) page_shrinker/try_to_unmap_one
addr = old_addr
lock(pte_ptl)
lock(pmd_ptl)
pmd = *old_pmd
pmd_clear(old_pmd)
CPU 1 CPU 2 CPU 3
mremap(old_addr, new_addr) page_shrinker/try_to_unmap_one
addr = old_addr
lock(pte_ptl)
lock(pmd_ptl)
pmd = *old_pmd
pmd_clear(old_pmd)