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=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS autolearn=ham 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 D00E2C282CB for ; Wed, 6 Feb 2019 02:10:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FABC2184E for ; Wed, 6 Feb 2019 02:10:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="TA+NN3CT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726914AbfBFCKd (ORCPT ); Tue, 5 Feb 2019 21:10:33 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:13275 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726610AbfBFCKd (ORCPT ); Tue, 5 Feb 2019 21:10:33 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 05 Feb 2019 18:09:56 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Tue, 05 Feb 2019 18:10:27 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 05 Feb 2019 18:10:27 -0800 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 6 Feb 2019 02:10:27 +0000 Subject: Re: [LSF/MM TOPIC] get_user_pages() pins in file mappings To: Jan Kara CC: , , , Dan Williams , Jerome Glisse References: <20190124090400.GE12184@quack2.suse.cz> <20190205112107.GB3872@quack2.suse.cz> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Tue, 5 Feb 2019 18:10:26 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190205112107.GB3872@quack2.suse.cz> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL108.nvidia.com (172.18.146.13) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US-large Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1549418996; bh=LrzDBXn7m4n3c90H00ykAOLq//WSnoIOgsc8KwJ6i7U=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=TA+NN3CTnNO9SN7o2OwFhQ8mdZrTB4ecEhe1Iyk3QO5s3ttTXHEmwZncXerTwFnsW y5YO1jAXocjNFAdLAXSMWL4gsdmt2ssTmIfTM1wUufECGWh3+VLa/hXWB8tT59zqQ+ qkgaVgk4rDNC7sU94mWAdfJmYgo+B4ywK63DdnMOo7TTgE6OaxQafM6NSyBNdR4taT TgCoXbpZTYHQHLdFJ9PBbKb4j1e5e5Urh1qdMyTPCEpW9SB2/5atzEx9R+XgHVIp8c R0n8oNjz7dDO5/6DOEF1QUKYvnUXC7d8JQpAErNjsOAZgrQ2VKv7cjgzfCbGDLEQ8x giq4t9KPPm3/Q== Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 2/5/19 3:21 AM, Jan Kara wrote: > Hi John, > > On Mon 04-02-19 15:46:10, John Hubbard wrote: >> On 1/24/19 1:04 AM, Jan Kara wrote: >> >>> In particular we hope to have reasonably robust mechanism of identifying >>> pages pinned by GUP (patches will be posted soon) - I'd like to run that by >>> MM folks (unless discussion happens on mailing lists before LSF/MM). We >>> also have ideas how filesystems should react to pinned page in their >>> writepages methods - there will be some changes needed in some filesystems >>> to bounce the page if they need stable page contents. So I'd like to >>> explain why we chose to do bouncing to fs people (i.e., why we cannot just >>> wait, skip the page, do something else etc.) to save us from the same >>> discussion with each fs separately and also hash out what the API for >>> filesystems to do this should look like. Finally we plan to keep pinned >>> page permanently dirty - again something I'd like to explain why we do this >>> and gather input from other people. >> >> Hi Jan, >> >> Say, I was just talking through this point with someone on our driver team, >> and suddenly realized that I'm now slightly confused on one point. If we end >> up keeping the gup-pinned pages effectively permanently dirty while pinned, >> then maybe the call sites no longer need to specify "dirty" (or not) when >> they call put_user_page*()? >> >> In other words, the RFC [1] has this API: >> >> void put_user_page(struct page *page); >> void put_user_pages_dirty(struct page **pages, unsigned long npages); >> void put_user_pages_dirty_lock(struct page **pages, unsigned long npages); >> void put_user_pages(struct page **pages, unsigned long npages); >> >> But maybe we only really need this: >> >> void put_user_page(struct page *page); >> void put_user_pages(struct page **pages, unsigned long npages); >> >> ? >> >> [1] https://lkml.kernel.org/r/20190204052135.25784-1-jhubbard@nvidia.com > > So you are right that if we keep gup-pinned pages dirty, drivers could get > away without marking them as such. However I view "keep pages dirty" as an > implementation detail, rather than a promise of the API. So I'd like to > leave us the flexibility of choosing a different implementation in the > future. And as such I'd just leave the put_user_pages_dirty() variants in > place. > > Honza OK, sounds good. And after all, removing that information from the call sites is easy, but adding it back in would be hell, so leaving it in definitely sounds better. I'm just looking for anything that says "this API isn't ready yet", but I guess we're still OK there. thanks, -- John Hubbard NVIDIA