Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp688115pxk; Thu, 17 Sep 2020 13:26:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyf5oCXVt5iiItS9Ie+cc4kcttuubvMyUv95YdTvJXRK9KYRMpiA/rtzwiVyvVPYcRCpuJ3 X-Received: by 2002:a17:906:a985:: with SMTP id jr5mr33783015ejb.549.1600374392495; Thu, 17 Sep 2020 13:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600374392; cv=none; d=google.com; s=arc-20160816; b=FjP6wGRI+m2N+V5XaxvmaPBDt6LTVImlC1E+i03KnP22LQXX/K+ySlMJ4breNj7mkV oIqvuNcMQWoiAj5QGkUHFyUHGF+EMbF/KX/S1g5/p49B3gsRPdWx3moFLJoNShf64VDW lAZip/ezU/fizkWYfv2sq6ZRFV6PPXFGHBtHmhhWORPJNeNStdbZKrfNKfvwhdidmtY4 tfqRqdTlaMGmTCZ9XhIguXG5RVir02KQgnxBWUGIvGxKTlE/D1TRTe9Y7Q40/6EbB1nY A0Ibk9+jdafzPH8LTj7KdDylvEFwKqMl2ZVe8yjJ+xBrRVlQ6wfxKAtjG7AhlHrLu6nC xxlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hb/NvhxGlTQOGkAb8QBT51mnjZK7SELytRM7upeU+SA=; b=Dott3rpR335CcLmYTyOkc/VU+NvCvCmvA6uXWKNV8PjNGWFjGpGfc/hiVJmHD3uXsE Jw8p/WLz3cxT5XxPLcQZSrkuSJz4vLpo4zquqrRrS400KsqS5srzHTomMw+x5J4+IMWs O4uZuM7nl2Db8r6dg1aVncZCSKathz9IPu8cmkg6IzdVo2nbwxbiK37VmcUFy8EnfgYD Rr+ohNb3FrKSwK0u4fVQPEpm8GaEPWvOTzcCYPMMBlNhtbgzvnCYWMjGeg8vvSH/2SkA y7CDRUik+UwXKIsiSTqLV//Hvwu4/LIAynRYOaQwGrrqM4ZucPVMAgNPSMxKq//2/jV4 2thA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=X+99c5GW; 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 re18si677090ejb.684.2020.09.17.13.26.09; Thu, 17 Sep 2020 13:26:32 -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=@ziepe.ca header.s=google header.b=X+99c5GW; 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 S1726596AbgIQUZR (ORCPT + 99 others); Thu, 17 Sep 2020 16:25:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726216AbgIQUZR (ORCPT ); Thu, 17 Sep 2020 16:25:17 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D99C06174A for ; Thu, 17 Sep 2020 13:25:17 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id t138so3736503qka.0 for ; Thu, 17 Sep 2020 13:25:17 -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=pco633rorQCwW6rJzg0NvYLVjq6nRNJ5ZcVZ0MjZk1eo8V2yyeSu31WzkNC26PdAOW 2C4XwlCXRrIQ7iJeyemtq2kKPRnu8E6FChcr/5QHgKkWgwP4Knv/25bOurUuFqLt/+zh 3sj/kCiNH9VjRpiPHI5X9+xJuUl6329ByRfsegm4bCuadeRfW6ZO3rlvQ+Xyi2mS8NG5 Ht4KnQ99bj8n9gHlDdMESLKnijkEAC/ykXG3xahzDWgGZ+/l5C/rvXCEaKSKiOd6lGuv pb+IvNhtf55JGewFXys4Muugt85nI1gIjrevQMJiURlbRSKbJ2mPtp8f+Do7gqCmZxee aOyQ== X-Gm-Message-State: AOAM532ynL7d2Kse5JOrf85OsIC+boFVS/g+YLhQ9pkBVa138MjoBaDJ QgrDWmu2/ThNW+2Xgl9lpNIing== 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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