Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1370390imm; Wed, 1 Aug 2018 14:56:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeghrE9L71bX9LR+UKMVWlRi0LI10UXLddYhihSSD4Q3kxFAN0mTyQR6fBZl9jj5ykKC/0O X-Received: by 2002:a65:550d:: with SMTP id f13-v6mr120086pgr.340.1533160602116; Wed, 01 Aug 2018 14:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533160602; cv=none; d=google.com; s=arc-20160816; b=ApX9tjaAmSiNqiPG/ZQQG6bBsfJchWAfwtV5kFSwlkFHqpSxKEh/s6WZt2PSBTtPp0 tmtAuOhfp+XvxWr4Ao/iXB5IU/mPMa30KeM54UHUOyDSUAzgb6Q0jdXBQ1+vsEWRfviY ZnyQ8hgN/UX0NfM8zHbfKgqu/qNGHBNoq3f0BGHCf8BJ1D78bICfJXKAbKd4SKIUaKmi cchBAaOp90QKtzKbeeIQKIGbgzpNwe5GigpRkycFq18XSpAO6vEiAhiXDwXUKlIl+coS GchgVxHEkj/xbqM7WBXNYkNhEQWa6PE0+2ZBFB2BLaeZpZaeYti3NCbK+ggKAzWndq68 mWYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=BrGcMCfuqBW04cMtUwDRaVcFdQjQwHiU8Batmrc0uRw=; b=yciY7rXm6bFo1nn0aChx37YYwhXzXi0tYBjFrD9kXq1WL0cbgb17K5c9PXeRCY59ka kYPJIdTG51KJGaZ+whU9sfGQ7Wk4UjFAbCmpAMQmC0Evg3xf+1xFYnhMCf96jzR6As+S mwkO+FBZKZr2cb1nZfxgT/46YbKy4exvo008R8JLmwHRZqSOIYwOjjEBrz9XGn5vbxKN /AY8F808gpC7NdSzqDUA+UVfIpEiNC14ObhY7L7NMoOAbQHTbOpZwAmK1YphIT6FgoFw U4s33bXtemLfaHu2HC7b3LsgzGKiCAdITt8eUXhaH6RRWYmqmxasbafGAb3lnZ3AaMJ2 vIBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nE9Aynkg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r29-v6si131549pff.24.2018.08.01.14.56.28; Wed, 01 Aug 2018 14:56:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nE9Aynkg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732530AbeHAXnX (ORCPT + 99 others); Wed, 1 Aug 2018 19:43:23 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:33462 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbeHAXnX (ORCPT ); Wed, 1 Aug 2018 19:43:23 -0400 Received: by mail-pl0-f67.google.com with SMTP id 6-v6so60400plb.0 for ; Wed, 01 Aug 2018 14:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=BrGcMCfuqBW04cMtUwDRaVcFdQjQwHiU8Batmrc0uRw=; b=nE9AynkgkzqshTFm78K9kSJLk2NQlYHIFdzY0RL742gACnvY8DsKksuVxkUuYhDz5U rmfK8rqC+QJqVb/jWgCBoS156Dr7jEf8gincVsvkuewjj/A7UV0iIccN6qtVrIvefl9l pYh3GP57ANLs+eH9MqWRPEhJtOr+LwnV66EsGmLSafWLsNCkrdSiQ8LrJqoy02OhKsdl a285woXd9Ylz+cg+fXIMhHShQLHLED7hMypIicVagDgTydbAq3osNYbNjw+gceENIk25 CCtY5Ee9o4gih96c4r4ioqTDmw605SfPHxFLc9jBRE8sgGbRCxt2LDsNcguy2D4ZIX9y F0Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=BrGcMCfuqBW04cMtUwDRaVcFdQjQwHiU8Batmrc0uRw=; b=VkyTKP506PMQy6uP53vh80IzDHD5CVGXSl2cK1rx1gf7B+z9oL2iI7kTV/sadvC2Kb gpRgWv011Q0c7VQgMadtHzPP7wMPFf2JUsOJMXiI7IdVVFCNWw9FTawLPpu8w2kVAlz1 fstT33KqFrzhU0pwTP0om/8mkUQDc9X3mA3T38Q+bUT/a5zaRUxLvp3kEYYa+4sv6guz EGCh57gbLlQAtqUOt6eQsxXgW7GlWLPS7a1wYu5QwQHAWc4o+mDPrNfXuYRyA+c/0zSA MAd/GhA9JSshxZcKNCAmYHlp9hQWCRSue2md0WfB2Wz4TnnvDyoDSY334ekB0AyU5lx4 dBbQ== X-Gm-Message-State: AOUpUlGcnZZW3joecPUxy+yOe9x5PRIsUwYpVoA03vAJNtoM3hfA+TiR rwQFJeFQJSlIn58q63ZRVz8ESA== X-Received: by 2002:a17:902:6b47:: with SMTP id g7-v6mr107545plt.128.1533160530257; Wed, 01 Aug 2018 14:55:30 -0700 (PDT) Received: from [100.112.75.99] ([104.133.8.99]) by smtp.gmail.com with ESMTPSA id j5-v6sm60623pff.139.2018.08.01.14.55.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 01 Aug 2018 14:55:28 -0700 (PDT) Date: Wed, 1 Aug 2018 14:55:20 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: "Kirill A. Shutemov" cc: Hugh Dickins , Linus Torvalds , Tony Luck , Amit Pundir , John Stultz , Matthew Wilcox , "Kirill A. Shutemov" , Andrew Morton , Dmitry Vyukov , Oleg Nesterov , Andrea Arcangeli , Greg Kroah-Hartman , linux-mm , Linux Kernel Mailing List , youling 257 , Joel Fernandes , Colin Cross Subject: Re: Linux 4.18-rc7 In-Reply-To: <20180801205848.6mgcfux4b63svj3n@kshutemo-mobl1> Message-ID: References: <20180731170328.ocb5oikwhwtkyzrj@kshutemo-mobl1> <20180731174349.GA12944@agluck-desk> <20180801205848.6mgcfux4b63svj3n@kshutemo-mobl1> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 1 Aug 2018, Kirill A. Shutemov wrote: > On Wed, Aug 01, 2018 at 11:31:52AM -0700, Hugh Dickins wrote: > > On Wed, 1 Aug 2018, Linus Torvalds wrote: > > > > > > 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 Thanks. > > > 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 cannot immediately think of an absolute reason why not, but I'm not giving it much thought; and that might turn it into a stranger beast than it already is. > > 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. I agree it's odd, but in this respect it's no odder than /dev/zero: that has exactly the same pattern of shmem_zero_setup() for VM_SHARED, else vma_set_anonymous(): which made me comfortable with John's patch, restoring the way it worked before. Admittedly, the subsequent vfs_fallocate() might generate surprises; and the business of doing a shmem_file_setup() first, and then undoing it with a shmem_zero_setup(), looks weird - from John's old XXX comment, I think it was a quick hack to piece together some functionality they needed in a hurry, which never got revisited (they wanted a name for the area? maybe memfd would be good for that now). But if what's in there is working now, I do not want to mess with it: I'd be adding bugs faster than removing them. Hugh