[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YK2YArvcaabj8GHi@t490s>
Date: Tue, 25 May 2021 20:36:18 -0400
From: Peter Xu <peterx@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Mike Kravetz <mike.kravetz@...cle.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Axel Rasmussen <axelrasmussen@...gle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Jerome Glisse <jglisse@...hat.com>
Subject: Re: [PATCH 2/6] mm/userfaultfd: Fix uffd-wp special cases for fork()
On Tue, May 25, 2021 at 05:15:58PM -0700, Andrew Morton wrote:
> This run afoul of Alistair's "mm: Device exclusive memory access",
> https://lkml.kernel.org/r/20210524132725.12697-8-apopple@nvidia.com
>
> `vma' is now undeclared. I think this?
>
> --- a/mm/memory.c~mm-userfaultfd-fix-uffd-wp-special-cases-for-fork-fix
> +++ a/mm/memory.c
> @@ -850,8 +850,8 @@ copy_nonpresent_pte(struct mm_struct *ds
> * exclusive entries currently only support private writable
> * (ie. COW) mappings.
> */
> - VM_BUG_ON(!is_cow_mapping(vma->vm_flags));
> - if (try_restore_exclusive_pte(src_mm, src_pte, vma, addr))
> + VM_BUG_ON(!is_cow_mapping(dst_vma->vm_flags));
This one looks good, as both src_vma/dst_vma should have the same flags related
to is_cow.
> + if (try_restore_exclusive_pte(src_mm, src_pte, dst_vma, addr))
Should this be s/dst_vma/src_vma/ perhaps? Alistairs please correct me
otherwise, as it tries to restore the pte for src mm not dst (the child).
I haven't yet got time to look at the new series, planning to do it tomorrow
maybe.. but I see that it's already queued in -mm. Andrew, we do have chance
to go back if necessary, right?
I haven't looked at the rest, but I think try_restore_exclusive_pte() can at
least drop the *mm pointer as it's never used (even if we need, we've got
vma->vm_mm too)..
--
Peter Xu
Powered by blists - more mailing lists