Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4216434imm; Mon, 30 Jul 2018 10:34:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfM17LIrEZGyNT+QnWaevbacenQZlsDBVQFPfbA4pgGyCZ1TzGmUuOBnFSbhToiekvS3tBO X-Received: by 2002:a17:902:262:: with SMTP id 89-v6mr17076813plc.221.1532972058996; Mon, 30 Jul 2018 10:34:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532972058; cv=none; d=google.com; s=arc-20160816; b=aVt4FscqQdwsatvG0ycaGjGTCYr1Ma4ILTDiwWNfY7fRe5xudr5YsEKomj6d6jCNuq qUqvWZtLZFbDGSa5yxVg/4oiImqA+DXOnDFWKR0BT4USqBwVoK3YxqrwO/nuYFu5k6Xa cWHvZNBaf2CpVmFCiadINio/IFGOPpTx23LxfzSo8HYER5IBDyn01pK6z1RM/uhXRPZM zSYnhrjlRC2RoYkhmZtAKJepDkQo7L5ZJyqS/oVab0jwmKzUGVHBSFo76gxz7/bpOZm8 J67CYgcpiQG1J/xiqi9XcrlDw1LI5wyhZvk66lv7HdyysgjwJvgPOiJYaQ0PRuxjbVmj cJyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=e4MB+Avo3ZXsHaKW3JB8ArpePPlFBMuC7LaL9vhQl9k=; b=xy5d+jAyIn6WsktaUxZcvjXIYVdKqIlo5lh+1ha8gU984I29z2Ldxdl3aRN1l19NDu ETgcMzqVOhlh3r+8vG9d0Z20nBHFY/BcV9ykZFbm6szwPk0KDlv0BPFoP5yUu2/XKYTo beKEHPBNSGdLSPPv0dtiHKHd9iq7X876MBITqqWUPLbY2phtMlOUxvgxc/RPSDEk+1r0 pcNbBF2m0XyR6jjU4935d8sxvbnbaO93o8V5ujgWaXU4UH8NxMCcFj22/PedVnsWUUHk nwK6n7+NwmLcWWXJAPQVFxhCXooTSgcM2/kRK6KyavKtr9bCQP8OA5Gc1/lO/KwW1HJW W8MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=JAV+u6BQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6-v6si11522699pgn.143.2018.07.30.10.34.04; Mon, 30 Jul 2018 10:34:18 -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=@linux-foundation.org header.s=google header.b=JAV+u6BQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728801AbeG3TJJ (ORCPT + 99 others); Mon, 30 Jul 2018 15:09:09 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:35833 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbeG3TJI (ORCPT ); Mon, 30 Jul 2018 15:09:08 -0400 Received: by mail-it0-f68.google.com with SMTP id q20-v6so380562ith.0 for ; Mon, 30 Jul 2018 10:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=e4MB+Avo3ZXsHaKW3JB8ArpePPlFBMuC7LaL9vhQl9k=; b=JAV+u6BQ0hY8Lc9i8qk1omfMCpI9YZwcUykn60VYA80vIqlTUu53N0jaKjH9hQiBCK GFQvkOeBeIXZhmLpYy6yRWQ/Z4H1WrQSrdeq7Cv1BA7cjE9SAYxGcFq5LNg/cYkH+Y50 OZkwQZ+gvSJhtFsL+H17Wrt3zQcFdxQTzKDmc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e4MB+Avo3ZXsHaKW3JB8ArpePPlFBMuC7LaL9vhQl9k=; b=BNZc4/RjHt82hTk3rITydLRv2RdZxt6TlbMeK2E9c/meB4VAKnDIaogj2L5ZT9TS5X /dEgegCy4B57DY95rtGhi5cw0fdURYUVDwQH1YRn7fiXPAkNciBSyfc7R77GNrbxYxED paInGxX08iy1QBq8fSkrRKu3LzQFWxUFVj8ObCgEv2kyjrsUYBdlVT33908rBOPSncT4 Pgj79M3R3sPOOpVg7Lu99mVeCs/lq9hPWfLUWDIaxkLZh6XO6HUNARJMLRW3kUfyCGHh joPY+05sobOr+2Tm09Sjd4uagWH0YL3TG+mqExCs5TOmDGHhoREl7xYa1D6CGYBg5ZJa 4Zkw== X-Gm-Message-State: AOUpUlGn3NFs22Mmyay6mUdGmTvZGzf4d6X1MSVozgCwd9w39xdJADmh qT8dhqjQcNqFLkWn+ygm4U8Mh1xp5LBamwBdYKk= X-Received: by 2002:a24:94f:: with SMTP id 76-v6mr197510itm.113.1532971986742; Mon, 30 Jul 2018 10:33:06 -0700 (PDT) MIME-Version: 1.0 References: <20180730130134.yvn5tcmoavuxtwt5@kshutemo-mobl1> In-Reply-To: <20180730130134.yvn5tcmoavuxtwt5@kshutemo-mobl1> From: Linus Torvalds Date: Mon, 30 Jul 2018 10:32:55 -0700 Message-ID: Subject: Re: Linux 4.18-rc7 To: "Kirill A. Shutemov" , Hugh Dickins , Matthew Wilcox Cc: Amit Pundir , "Kirill A. Shutemov" , Andrew Morton , Dmitry Vyukov , Oleg Nesterov , Andrea Arcangeli , Greg Kroah-Hartman , John Stultz , linux-mm , Linux Kernel Mailing List , youling257@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 30, 2018 at 6:01 AM Kirill A. Shutemov wrote: > > I think I missed vma_set_anonymous() somewhere, but I fail to see where. Honestly, by now we just need to revert that commit. It's not even clear that it was a good idea to begin with. The rest of the commits were cleanups, this one was driven by a incorrect VM_BUG_ON() that triggered, and that checked "vma_is_anonymous(vma)" without any explanations of wht it should matter. I think the biggest problem with vma_is_anonymous() may be its name, not what it does. What the code historically *did* (and what vma_is_anonymous() checks) is not "is this anonymous", but rather "does this have any special operations associated with it". The two are similar. But people have grown opinions about exactly what "anonymous" means. If we had named it just "no_vm_ops()", we wouldn't have random crazy checks for "vma_is_anonymous()" in places where it makes no sense. So what I think we want a real explanation for is why people who use "vma_is_anonymous()" care. Instead of trying to change its very historical meaning, we should look at the users, and perhaps change its name. In this case, for example, I think the *real* problem was described by commit 684283988f70 ("huge pagecache: mmap_sem is unlocked when truncation splits pmd"), and the problem is that an existing check that required that mmap_sem was held was changed to say "only for anonymous mappings". But the fact is, you can truncate mappings that don't have any ops just *fine*. So maybe that original BUG() was entirely bogus to begin with, and it shouldn't exist at all? Or maybe the code should test "do I have a vm_file" instead of testing "do I have vm_ops"? What's the problem with just doing split_huge_pmd() there when it's a pmd_trans_huge or pmd_devmap pmd? Why is that VM_BUG_ON_VMA() there in the first place? Why are allegedly "anonymous" mappings so special here for locking? Adding a few more people to the cc, they were involved the last that time VM_BUG_ON_VMA() was modified. New people: see commit bfd40eaff5ab ("mm: fix vma_is_anonymous() false-positives") for details. Right now I think it's getting reverted, but the oops explanation in the commit is about that kernel BUG at mm/memory.c:1422! which was/is debatable and seems to make no sense (and definitely is still triggerable despite that commit 684283988f70 ("huge pagecache: mmap_sem is unlocked when truncation splits pmd") that limited it a bit - but I think it didn't limit it enough. Linus