On Wed, Oct 02, 2019 at 03:47:24PM +0200, Thomas Hellström (VMware) wrote:
> From: Thomas Hellstrom <thellst...@vmware.com>
> 
> The caller needs to make sure that the vma is not torn down during the
> lock operation and can also use the i_mmap_rwsem for file-backed vmas.
> Remove the BUG_ON. We could, as an alternative, add a test that either
> vma->vm_mm->mmap_sem or vma->vm_file->f_mapping->i_mmap_rwsem are held.
> 
> Cc: Andrew Morton <a...@linux-foundation.org>
> Cc: Matthew Wilcox <wi...@infradead.org>
> Cc: Will Deacon <will.dea...@arm.com>
> Cc: Peter Zijlstra <pet...@infradead.org>
> Cc: Rik van Riel <r...@surriel.com>
> Cc: Minchan Kim <minc...@kernel.org>
> Cc: Michal Hocko <mho...@suse.com>
> Cc: Huang Ying <ying.hu...@intel.com>
> Cc: Jérôme Glisse <jgli...@redhat.com>
> Cc: Kirill A. Shutemov <kir...@shutemov.name>
> Signed-off-by: Thomas Hellstrom <thellst...@vmware.com>

The patch looks good to me:

Acked-by: Kirill A. Shutemov <kirill.shute...@linux.intel.com>

But I looked at usage at pagewalk.c and it is inconsitent.  The walker
takes ptl before calling ->pud_entry(), but not for ->pmd_entry().

It should be fixed: do not take the lock before ->pud_entry(). The
callback must take care of it.

Looks like we have single ->pud_entry() implementation the whole kernel.
It should be trivial to fix.

Could you do this?

-- 
 Kirill A. Shutemov

Reply via email to