From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39946C4727E for ; Sat, 26 Sep 2020 01:16:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7D0B42075A for ; Sat, 26 Sep 2020 01:16:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="UDmpX01c" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D0B42075A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B391D6B005C; Fri, 25 Sep 2020 21:16:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC3D26B0062; Fri, 25 Sep 2020 21:16:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 964628E0001; Fri, 25 Sep 2020 21:16:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id 7CC506B005C for ; Fri, 25 Sep 2020 21:16:02 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2F665180AD801 for ; Sat, 26 Sep 2020 01:16:02 +0000 (UTC) X-FDA: 77303446164.21.robin09_3f1060b2716c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 0C993180442C0 for ; Sat, 26 Sep 2020 01:16:02 +0000 (UTC) X-HE-Tag: robin09_3f1060b2716c X-Filterd-Recvd-Size: 4969 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Sat, 26 Sep 2020 01:16:01 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id r24so3917350ljm.3 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=sMd6fZyi7SfFdQ74chbY8ZADzqRwMRADky+DQdwhUZnitwPoMxLfCtNLeE7gDITEAC 9Ogs3fxN843G0Gf+iCgxLiZylAojai0ufxDfAAXkQUpUKWoRRnPOi44EDJFTIbDAI6D0 6KSuIqvwoXOrK3vjejm8h3shAz52BJ/tSUgEq36tzTU5arsOvOZal6L7n6mbfpEMJyw+ JYHZrFxoJRkPpDoFik3JdmzWr2+PADVUQCAovzTLKbRRd0Ky5mqZouLwWR4YSdiP93gO Lt2sKUILH7H0fdeWMPKi93uCl4obTxglydODkBOriofEKNd2/agVvl1wq+BZ6VSAQX4C Onmw== X-Gm-Message-State: AOAM5338HBm+lfBm7H2YmsYX1pKv5elim9Mx4IgFGMYupYiKvTnLWP9R m/cLsEMC0WOEs7TV5fhGcLV9O9rrryODKw== X-Google-Smtp-Source: ABdhPJy15lIKu5VyjBb7fb7dJmKNplLW4mMVkWxOqQZyUVtfYs44f90QeRvi+B1XkzyYd7xmCK/C3A== X-Received: by 2002:a2e:3208:: with SMTP id y8mr2242159ljy.216.1601082959402; Fri, 25 Sep 2020 18:15:59 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id m1sm546117lfh.99.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-f43.google.com with SMTP id b22so4727042lfs.13 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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