Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3626974imm; Mon, 18 Jun 2018 01:05:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL/T+OrRDkJ/YAPVYhxom+s+YkjoB5fwJpmwiHX2xriHw7IFbi+lnhEz1tMUGEVfithoAbD X-Received: by 2002:a17:902:a9:: with SMTP id a38-v6mr13126249pla.102.1529309108505; Mon, 18 Jun 2018 01:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529309108; cv=none; d=google.com; s=arc-20160816; b=Msb5hOATsyPPF6823jV+gyObwzpIG9uHAnoxyMHlEj6m989uZOTCgVMxBO6a2MQPso FhY3t7yjAXIZtlZqDtd2OcEa8IW8xFX4ZhmQxAerN4IX/5zdPShC1YVe1oOdRDRDSQ0k vtVoRX7Rblz1VZWtuNlasyhmaJHrHZ39mmeklz/YkpgphlJ00L0MQ/0WlZedgypxMMst We9pkXTJ6J7tUW3ffXX6ktUhMXQf6npxJFBRNoOl0Xw4Z0EPmYUDpfOa2a2IVLurdFYd ohc/YpCTRgOMDS23hXAsHf6/SfK4BRR2OWh2z/cTrB72F5g4JTOLgYtRsKm+nCFGtWdg 0C1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=lap0klbDT58XlAQN+gd/IEX0IHoZhZRCN7DWeNobqKY=; b=WUO3S0wyxuH/d0eQLfO1Jy4JTuyi98wpKILWEu8DkMykr58+lDBu8keptlNteBY5XK zXucmQXQIAYIP8YkSpaDsU6KrRWpLmUMXX7bYnx7KaIAWB1dYzVOZmXi7gOpGw6uNDK+ APvf0yVh4LjMtkxqYMz1liJfbt9B/4hQ/TYFeJf9p45dvf9CmwdyUI83j+lMiCi4+wxt D25hzpcDPR+/4HRD6g9Wi7yKvIwnmjPZrjWOpFuRgLfw5Wt8Pgq403AIwZDoPyLGs/eF t2KgRXie235XSr51MgyJN4XiBjDouFwLDTsa8kk6T9wusu5r6p1zvJeMYbZkhG++3SBE SynA== ARC-Authentication-Results: i=1; mx.google.com; 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 b10-v6si14029586pls.501.2018.06.18.01.04.54; Mon, 18 Jun 2018 01:05:08 -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; 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 S933182AbeFRIEI (ORCPT + 99 others); Mon, 18 Jun 2018 04:04:08 -0400 Received: from verein.lst.de ([213.95.11.211]:33943 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932723AbeFRIEH (ORCPT ); Mon, 18 Jun 2018 04:04:07 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 72C3568E44; Mon, 18 Jun 2018 10:12:58 +0200 (CEST) Date: Mon, 18 Jun 2018 10:12:58 +0200 From: Christoph Hellwig To: John Hubbard Cc: Dan Williams , Jason Gunthorpe , john.hubbard@gmail.com, Matthew Wilcox , Michal Hocko , Christopher Lameter , Jan Kara , Linux MM , LKML , linux-rdma , Christoph Hellwig Subject: Re: [PATCH 2/2] mm: set PG_dma_pinned on get_user_pages*() Message-ID: <20180618081258.GB16991@lst.de> References: <20180617012510.20139-1-jhubbard@nvidia.com> <20180617012510.20139-3-jhubbard@nvidia.com> <20180617200432.krw36wrcwidb25cj@ziepe.ca> <311eba48-60f1-b6cc-d001-5cc3ed4d76a9@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <311eba48-60f1-b6cc-d001-5cc3ed4d76a9@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jun 17, 2018 at 01:28:18PM -0700, John Hubbard wrote: > Yes. However, my thinking was: get_user_pages() can become a way to indicate that > these pages are going to be treated specially. In particular, the caller > does not really want or need to support certain file operations, while the > page is flagged this way. > > If necessary, we could add a new API call. That API call is called get_user_pages_longterm. > But either way, I think we could > reasonably document that "if you pin these pages (either via get_user_pages, > or some new, similar-looking API call), you can DMA to/from them, and safely > mark them as dirty when you're done, and the right things will happen. > And in the interim, you can expect that the follow file system API calls > will not behave predictably: fallocate, truncate, ..." That is not how get_user_pages(_fast) is used. We use it all over the kernel, including for direct I/O. You'd break a lot of existing use cases very badly.