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 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 03299C43463 for ; Thu, 17 Sep 2020 20:25:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 925C6206B7 for ; Thu, 17 Sep 2020 20:25:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="X+99c5GW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 925C6206B7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 05D3A6B0003; Thu, 17 Sep 2020 16:25:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00D366B005A; Thu, 17 Sep 2020 16:25:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF0A58E0001; Thu, 17 Sep 2020 16:25:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0193.hostedemail.com [216.40.44.193]) by kanga.kvack.org (Postfix) with ESMTP id C8C996B0003 for ; Thu, 17 Sep 2020 16:25:17 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 82DDC2A87 for ; Thu, 17 Sep 2020 20:25:17 +0000 (UTC) X-FDA: 77273683074.26.bike57_0d0fef027125 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 6F0ED1804B669 for ; Thu, 17 Sep 2020 20:25:17 +0000 (UTC) X-HE-Tag: bike57_0d0fef027125 X-Filterd-Recvd-Size: 4865 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 20:25:16 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id f142so3659702qke.13 for ; Thu, 17 Sep 2020 13:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hb/NvhxGlTQOGkAb8QBT51mnjZK7SELytRM7upeU+SA=; b=X+99c5GW9un6SPrnLDbMdN14ayb+SsTeBo9tqOEEjShXWP8rdjTHbV90pOoeoDgyNk ao0fgmrXUoeFtpWjllc9gAtOT+spEEIrvjk14HjI3Ly6STtEGcUk0KpcNj6ZeSVz0hzI i7MFkMUXe0waOZjJ9PDTdmuyrZR34oRufqXayFubinza8YjyuW8QUSwhoJ55Fu8/pVBI jh8p7U5AgM1bMpGL/N81LSN2xyGJNZ6cW9+M5fXg3MDhl1BJE2uDDbgSgYKDUL9sbpDb EOqbO0Zf5weKeut8h6vWmA1jVK6fohi5Y8GFrZNPfFvZDKg+s8weru+1lIDBRiW0lhT4 kgRg== 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:message-id:references :mime-version:content-disposition:in-reply-to; bh=hb/NvhxGlTQOGkAb8QBT51mnjZK7SELytRM7upeU+SA=; b=BwJwg8C1BnnjTDtjcgyenBzLdYc6svwWC529eo7br2jCFJa13vYebufEa3EgyMy4qA WMEhnq1C9/0HSwL8nTiEIibsIOKJp7tQvKczkWxi4wZP3aTtSsyIz5lTZpgkZQlIGI46 1TA3hVt2t+kD8PNhMQgNa7PFCyMwNi5Mec7mcAC082rZ0E8sT5NjE9Jn2TJW7948mSif GmYgdznQ1kfplSvRbp6GEjSjn2dvBqSlgw5O4FeBykyGSy/jEJrgvNFX1EsGC4IRFMdd YBNOUzlSQbIj3DuS9l3ujcTT9ifyajQIFa7oDkzLBVbe1fF7mziKpCAY8e2thn4+TbZY q9rg== X-Gm-Message-State: AOAM530anWOxf8ocpg9u2/5UcO/tj9mOkr41pgoMcjwidudkRU03s+XG BRSW4SPqQDDcvqFsXKc9KDDBNA== X-Google-Smtp-Source: ABdhPJyGHFVbWVpn7pUZNbKM3NvObWEGi7YtDcOpfmlW7eJyn5NktwnpqKLnTt/1radk9XI0Vr5Hqg== X-Received: by 2002:a37:54a:: with SMTP id 71mr26830800qkf.407.1600374316326; Thu, 17 Sep 2020 13:25:16 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id z3sm583141qkf.92.2020.09.17.13.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2020 13:25:15 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1kJ0Sw-000lSJ-U4; Thu, 17 Sep 2020 17:25:14 -0300 Date: Thu, 17 Sep 2020 17:25:14 -0300 From: Jason Gunthorpe To: John Hubbard Cc: Linus Torvalds , Peter Xu , Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , Yang Shi , Marty Mcfadden , Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification Message-ID: <20200917202514.GN8409@ziepe.ca> References: <20200916174804.GC8409@ziepe.ca> <20200916184619.GB40154@xz-x1> <20200917112538.GD8409@ziepe.ca> <20200917181411.GA133226@xz-x1> <20200917190332.GB133226@xz-x1> <20200917200638.GM8409@ziepe.ca> <24b8ad6b-4e4c-4651-86e6-bc2232fce772@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24b8ad6b-4e4c-4651-86e6-bc2232fce772@nvidia.com> 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 Thu, Sep 17, 2020 at 01:19:02PM -0700, John Hubbard wrote: > On 9/17/20 1:06 PM, Jason Gunthorpe wrote: > > On Thu, Sep 17, 2020 at 12:42:11PM -0700, Linus Torvalds wrote: > ... > > > Is there possibly somethign else we can filter on than just > > > GUP_PIN_COUNTING_BIAS? Because it could be as simple as just marking > > > the vma itself and saying "this vma has had a page pinning event done > > > on it". > > > > We'd have to give up pin_user_pages_fast() to do that as we can't fast > > walk and get vmas? > > oops, yes. I'd forgotten about that point. Basically all of the O_DIRECT > callers need _fast. This is a big problem. What about an atomic counter in the mm_struct? # of pages currently under pin. The use case Linus is worried about will never have any pins, so it would be 0 and it could skip this entire test. Jason