Re: Linux 4.18-rc7
From: Kirill A. Shutemov <hidden>
Date: 2018-08-01 20:58:58
Also in:
lkml
On Wed, Aug 01, 2018 at 11:31:52AM -0700, Hugh Dickins wrote:
On Wed, 1 Aug 2018, Linus Torvalds wrote:quoted
Anyway, the upshot of all this is that I think I know what the ia64 problem was, and John sent the patch for the ashmem case, and I'm going to hold off reverting that vma_is_anonymous() false-positives commit after all.I'd better send deletion of zap_pmd_range()'s VM_BUG_ON_VMA(): below (but I've no proprietorial interest, if you prefer to do your own).
Agreed. Acked-by: Kirill A. Shutemov <redacted>
John's patch is good, and originally I thought it was safe from that VM_BUG_ON_VMA(), because the /dev/ashmem fd exposed to the user is disconnected from the vm_file in the vma, and madvise(,,MADV_REMOVE) insists on VM_SHARED. But afterwards read John's earlier mail, drawing attention to the vfs_fallocate() in there: I may be wrong, and I don't know if Android has THP in the config anyway, but it looks to me like an unmap_mapping_range() from ashmem's vfs_fallocate() could hit precisely the VM_BUG_ON_VMA(), once it's vma_is_anonymous(). (I'm not familiar with ashmem, and I certainly don't understand the role of MAP_PRIVATE ashmem mappings - hole-punch's zap_pte_range() should end up leaving any anon pages in place; but the presence of the BUG is requiring us all to understand too much too quickly.)
Hugh, do you see any reason why ashmem shouldn't have vm_ops == shmem_vm_ops? I don't understand ashmem, but I feel uncomfortable that we have this sneaky way to create an anonymous VMA. It feels wrong to me. -- Kirill A. Shutemov