Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1532216pxk; Fri, 25 Sep 2020 18:19:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsoKNHH4toUTJPYCpfII7ODo2dFaGy9W96VdubwpS6zygRByYz1ANCYapJkRleEO4ujE1F X-Received: by 2002:a17:906:1fd5:: with SMTP id e21mr5650038ejt.349.1601083168863; Fri, 25 Sep 2020 18:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601083168; cv=none; d=google.com; s=arc-20160816; b=dKSUtBwH+tqfWOPXHw9xe3/2w87Wh1F89CkKTqCaDWsXmYNkz++id4AhYlZr2QEc5A I4uVwyUQ+7W0WlhSuzA2ar/U0lF1FbMqDitavCWTiYvJ/2K6KHZdfkfSqxC7L+gqo9/Q WcB3tcbl5b4aZGhPWiK125QEq3RrdUUd/XYgsp3eKEqw7am/dgdh6LmR1VBEH1f2X9Ut 7iHcy+GNqw8MVRitHuyF7ZXZDmE1WzVth4CwBPJLYjfyMo8DtsNQjpQC4uMEUzIQP3Hs xu0fDN4Qnaw+lOgEz5GnjUdCOcDBfFWHwAE2UxoDS68pIrouV/zYY/yrhwZCqzh9n5LZ e9fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hpchNS/oWTSmppDZkrORDu0nnNayAF0+YJG3NCCqrs4=; b=wydQI+J3e4judfOTS60Y90hZkmEFUxCZNCh1KM+QtkO1lxHoobBlo/Ig+OjKfuatGa tYAI7inSvNBH2lsOh//ToZPhENrfB/lb0llk73FbZA1xUHUlVgWhDmIP+t09tazTiMYm 3w+8pSys236OwmYiMzcVmzA6XXQgsctN9cyW9A9I7yTegrftU3o1WKqrX4pObQmZm+ri G3OLb3i3djReV1nSRJ7nGDv070s/3aIDuXzQ+Cn3vz+bUyTqqF6Cije2vnBclvneZ2vJ kJ6Y+fl4xfsEK8eBkc54UI0TcSaMWVo3VysdC6x4OKOiw+pivPRHHvCZo+CIzd0uZAWt sieQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UDmpX01c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si2609200ejg.609.2020.09.25.18.19.06; Fri, 25 Sep 2020 18:19:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=UDmpX01c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729960AbgIZBQC (ORCPT + 99 others); Fri, 25 Sep 2020 21:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729729AbgIZBQC (ORCPT ); Fri, 25 Sep 2020 21:16:02 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 017F2C0613CE for ; Fri, 25 Sep 2020 18:16:02 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id 77so4791943lfj.0 for ; Fri, 25 Sep 2020 18:16:01 -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=hpchNS/oWTSmppDZkrORDu0nnNayAF0+YJG3NCCqrs4=; b=UDmpX01c0bTTWobylw+tZ/OUa9A9C6aMBxlpL2FZ0IWoS6Me35OFasjN/vnNQk7wxv 5MgRTlYBvfRBIZC9uj749H22vgFQeBOKbm1LgiBESn3scwoJJo/0JeF9tjORZGV5hmZO DVGyCz2vJF4oFYb+jzkVHjYKBzOGTX67JSf4w= 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=hpchNS/oWTSmppDZkrORDu0nnNayAF0+YJG3NCCqrs4=; b=sN/y1PeS+POWGXzFTlVSRx8VkEud9LtaCWcgzDnDamqvuo1j+FX4RzYpRrpzcIZQHO mY7KSICOoXylwZz+w7uk62v4jogaiKwxVm49TE19fYc+9fze38V40/QLhx5oa/aXYYZ6 cjAT3mDAm573i765XsVMs517CKqd7mytbmezWDDPMdT6a7/eV9dE/W0NqVzSlmgIeSq3 UNO+7iJhnUq+J93q7DEWtcpPp+aspa3th8xjQoJR/3ouOXhv/1ix0EkatZrpL6s5vXYA mRhL4EFk7eyI9Fc67lZ9H74SVA6mAzRt6LMp545DcAD3Vygtkbzyx8eG7cxXH6hWwaAL QJ8Q== X-Gm-Message-State: AOAM530ZYA1cnsSvvZlYu1mzB8DHZyTKEM/f5wtKG8ukoxmbQ4QhONtq WAZJXo3y5UgudkdqNrX8iamnxG9/EM5zng== X-Received: by 2002:a19:fc02:: with SMTP id a2mr412538lfi.443.1601082959607; Fri, 25 Sep 2020 18:15:59 -0700 (PDT) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id 140sm543143lfj.146.2020.09.25.18.15.54 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Sep 2020 18:15:54 -0700 (PDT) Received: by mail-lf1-f48.google.com with SMTP id w11so4797930lfn.2 for ; Fri, 25 Sep 2020 18:15:54 -0700 (PDT) X-Received: by 2002:ac2:4a6a:: with SMTP id q10mr409204lfp.534.1601082953646; Fri, 25 Sep 2020 18:15:53 -0700 (PDT) MIME-Version: 1.0 References: <20200923170759.GA9916@ziepe.ca> <20200924143517.GD79898@xz-x1> <20200924165152.GE9916@ziepe.ca> <20200924175531.GH79898@xz-x1> <20200924181501.GF9916@ziepe.ca> <20200924183418.GJ79898@xz-x1> <20200924183953.GG9916@ziepe.ca> <20200924213010.GL79898@xz-x1> <20200926004136.GJ9916@ziepe.ca> In-Reply-To: <20200926004136.GJ9916@ziepe.ca> From: Linus Torvalds Date: Fri, 25 Sep 2020 18:15:37 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/5] mm: Introduce mm_struct.has_pinned To: Jason Gunthorpe Cc: Peter Xu , John Hubbard , Linux-MM , Linux Kernel Mailing List , Andrew Morton , Jan Kara , Michal Hocko , Kirill Tkhai , Kirill Shutemov , Hugh Dickins , Christoph Hellwig , Andrea Arcangeli , Oleg Nesterov , Leon Romanovsky , Jann Horn Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 5:41 PM Jason Gunthorpe wrote: > > I don't completely grok the consequences of the anon_vma check. We > can exclude file backed mappings as they are broken for pinning > anyhow, so what is left that could be MAP_PRIVATE of a non-anon_vma? It really shouldn't ever happen. The only way a COW vma can have a NULL anon_vma should be if it has no pages mapped at all. Technically I think it could happen if you only ever mapped the special zero page in there (but that shouldn't then get to the "vm_normal_page()"). > Otherwise, I do prefer Peter's version because of the GFP_KERNEL. To > touch on your other email.. Yeah, no, I just hadn't seen a new version, so I started getting antsy and that's when I decided to see what a minimal patch looks like. I think that over the weekend I'll do Peter's version but with the "page_mapcount() == 1" check, because I'm starting to like that better than the mm->has_pinned. Comments on that plan? Linus