Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1278848imm; Wed, 1 Aug 2018 13:08:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcx2NpoRlTgT38FbE84/HY84x9Nn6Ncb06fWbzeLIjPYQin/+UFXkpYlaH+sfUYyMPmPzb6 X-Received: by 2002:a63:7252:: with SMTP id c18-v6mr25324918pgn.186.1533154108072; Wed, 01 Aug 2018 13:08:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533154108; cv=none; d=google.com; s=arc-20160816; b=AmhZ/WneHor6TlTTRw5WZ/DYTUZFJViyzJoj2HDN5sxBmdYuSam3TqXVaRhZRGFDVP 9LzSo591GMHRwmh2jkEmYu7EEyHKHVBvKY+xC5Xq+soF7v/GA4mwXT68U8RMWU3PY6XG 3Ftjdxaxvftmu9DnVEw2uFC+nQFMTnRyznCP+TP7iyJYuTFZ58jWvvtn8nv9cV7U51h7 MK3vz9LvYHW4fREsf1aPvun1PvqGENQ1BtBbOqDz+XJhzxBCFb8BuWFRkbRrW+gLe+qG s2crPxA+sydOgd71bvuy69WJZ5ClSPIiFRWVfkKoXKTFIIbIcjWCWya1tHdRcyrpiQnK Aa1Q== 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=XUPpdoNmM96E6CAK7HuYvFcQ1h2N+1qgHXQPi52W3tE=; b=WGS1yq5hQbcMYb3bec4AppcjlIRG1j2/7whUyIVWsU7aTFfjjyfF5lxusReD+kZmu3 uHSbrCrv6TLxrYp7wRFAcwZUUExLkfaGybzSLt4Hn8rHozH9OsZxWRmXdYKiWNmsSzhz QkAM2E3/ZwviroAndE5kx+oMWZiG1/nyWmxdlO5Xz0fDLnfsQ/r6U2TZaJ+PTcDZYoyZ C5CWmfUki7x+FtueyozMIV/aFKqEkeL93YRDbE4ZQ2Pw84A7oxJYkLXRJQPIBKTyPvch PePCwI+eH9Qu+5Rtngc1ArFQvZy4Ebl7RgtA/WqRAdlbImxBtQZZKR6pdTrDlGo/aKui B0Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Vu2UlTju; 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 z125-v6si16833589pfz.10.2018.08.01.13.08.13; Wed, 01 Aug 2018 13:08:28 -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=Vu2UlTju; 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 S1731590AbeHAVx1 (ORCPT + 99 others); Wed, 1 Aug 2018 17:53:27 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:39618 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729899AbeHAVx1 (ORCPT ); Wed, 1 Aug 2018 17:53:27 -0400 Received: by mail-it0-f68.google.com with SMTP id g141-v6so481336ita.4 for ; Wed, 01 Aug 2018 13:06:00 -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=XUPpdoNmM96E6CAK7HuYvFcQ1h2N+1qgHXQPi52W3tE=; b=Vu2UlTjuNpVbmUq8uv72u1N5E8232Q5X5PnlHQs1UR835pQB0KxSinU3ROCimpWdCz Zua4+CHzZzjF9vyc63oVjfncWeKPAPI1BQtcwVCW4XQd66oLNVyRDKlDE1SoM2cxhZOU SJr/duI2SOqhVDGGIZUWyqGoqQcbqpolVaavo= 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=XUPpdoNmM96E6CAK7HuYvFcQ1h2N+1qgHXQPi52W3tE=; b=jZhhlYmEiOO/8YxPo+ytyQQ43aMB5TmHMAdtR8mrmne89I4lCf+7faJ36uNvSGSuaA 2KkmF30Gfw+LZADr0ErGTSTQMZjgLq1Dw/rs0nPp6FtqPa18En+RxbQISnhLgFJV+kew /xVBWJvvm2+6g0KA/J7A2PuaXuMFMmHzA6r7DJNXd3kxX7QZw8pLiIP3s7PWYfzhwYwP tObTTHlTkYSJH8MP09k3wF2wWd6uN2T+on2tNMfCdDHKFdf2rrs4cLVZZPktSYRG0GYR TEXTEvAos8cwA4q6mUHE3ji5WUrWllOGRhawel/hsFWWlmRFHb/GWpbMMeeNCjcEhLeZ WGjQ== X-Gm-Message-State: AOUpUlFNIP1xeot15IYhOCTIL57rNOlbfag/6tLJ9TUCApBRZj5tH+fV 6AVbSJoBe9D6Mpx/i2SJ0HGn+7o1qi3BtxYKSzM= X-Received: by 2002:a24:94f:: with SMTP id 76-v6mr271420itm.113.1533153959936; Wed, 01 Aug 2018 13:05:59 -0700 (PDT) MIME-Version: 1.0 References: <20180730130134.yvn5tcmoavuxtwt5@kshutemo-mobl1> <20180731170328.ocb5oikwhwtkyzrj@kshutemo-mobl1> <20180731174349.GA12944@agluck-desk> In-Reply-To: From: Linus Torvalds Date: Wed, 1 Aug 2018 13:05:48 -0700 Message-ID: Subject: Re: Linux 4.18-rc7 To: Tony Luck Cc: "Kirill A. Shutemov" , Amit Pundir , John Stultz , Hugh Dickins , 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 Content-Type: multipart/mixed; boundary="0000000000002b2e110572653938" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0000000000002b2e110572653938 Content-Type: text/plain; charset="UTF-8" On Wed, Aug 1, 2018 at 10:15 AM Linus Torvalds wrote: > > I'm still unhappy about the vma_init() ones, and I have not decided > how to go with those. Either the memset() in vma_init(), or just > reverting the (imho unnecessary) commit 2c4541e24c55. Kirill, Andrew, > comments? Ugh. Adding a memset looks simple, but screws up some places that have other initialization. It also requires adding a new include of , or we'd need to uninline vma_init() and put it somewhere else. But just reverting commit 2c4541e24c55 ("mm: use vma_init() to initialize VMAs on stack and data segments") entirely isn't good either, because some of the cases aren't about the TLB flush interface, and call down to "real" VM functions. The 'pseudo_vma' use of remove_inode_hugepages() and hugetlbfs_fallocate() in particular is odd, but using vma_init() looks good there. And those places had the memset() already. So I'm inclined to simply mark the TLB-related vma_init() cases special, and use something like this: #define TLB_FLUSH_VMA(mm,flags) { .vm_mm = (mm), .vm_flags = (flags) } to make it very obvious when we're doing that vma initialization for flush_tlb_range(). It's done as an initializer, exactly so that the only valid syntax is to do somethin glike this: struct vm_area_struct vma = TLB_FLUSH_VMA(mm, VM_EXEC); That leaves vma_init() users to be just the actual real allocation path, and a few very specific specual vmas (the hugetlbfs and mempolicy pseudo-vma, and a couple of "gate" vmas). Suggested patch attached. Comments? Linus --0000000000002b2e110572653938 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jkbk9vui0 IGFyY2gvYXJtL21hY2gtcnBjL2VjYXJkLmMgICAgfCAgNSArLS0tLQogYXJjaC9hcm02NC9pbmNs dWRlL2FzbS90bGIuaCB8ICA0ICstLS0KIGFyY2gvYXJtNjQvbW0vaHVnZXRsYn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