On Tue, 8 Jun 2021, Aneesh Kumar K.V wrote:
>
> mm/mremap: hold the rmap lock in write mode when moving page table
> entries.
>
> To avoid a race between rmap walk and mremap, mremap does
> take_rmap_locks().
> The lock was taken to ensure that rmap walk don't miss a page table
On Tue, Jun 08, 2021 at 04:47:19PM +0530, Aneesh Kumar K.V wrote:
> On 6/8/21 3:12 PM, Kirill A. Shutemov wrote:
> > On Tue, Jun 08, 2021 at 01:22:23PM +0530, Aneesh Kumar K.V wrote:
> > >
> > > Hi Hugh,
> > >
> > > Hugh Dickins writes:
> > >
> > > > On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote:
On 6/8/21 3:12 PM, Kirill A. Shutemov wrote:
On Tue, Jun 08, 2021 at 01:22:23PM +0530, Aneesh Kumar K.V wrote:
Hi Hugh,
Hugh Dickins writes:
On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote:
CPU 1 CPU 2 CPU 3
mremap(old_addr, new_addr
On Tue, Jun 08, 2021 at 01:22:23PM +0530, Aneesh Kumar K.V wrote:
>
> Hi Hugh,
>
> Hugh Dickins writes:
>
> > On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote:
> >
> >> CPU 1 CPU 2
> >> CPU 3
> >>
> >> mremap(old_addr, new_addr) pa
Hi Hugh,
Hugh Dickins writes:
> On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote:
>
>> CPU 1CPU 2
>> CPU 3
>>
>> mremap(old_addr, new_addr) page_shrinker/try_to_unmap_one
>>
>> mmap_write_lock_killable()
>>
>>
On Mon, 7 Jun 2021, Aneesh Kumar K.V wrote:
> CPU 1 CPU 2 CPU 3
>
> mremap(old_addr, new_addr) page_shrinker/try_to_unmap_one
>
> mmap_write_lock_killable()
>
> addr = old_addr
>
CPU 1 CPU 2 CPU 3
mremap(old_addr, new_addr) page_shrinker/try_to_unmap_one
mmap_write_lock_killable()
addr = old_addr
lock(pte_ptl)
lock(pmd_ptl)
pmd = *old_pmd
pmd_c