Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp194455imm; Tue, 19 Jun 2018 19:05:53 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJQ1Jb7kzErBSgVtSm3YuzkoIyQt/ret2ewtY5DdtGrjDa3MSCT+76cGWFIGpsSvH587+jJ X-Received: by 2002:a17:902:5390:: with SMTP id c16-v6mr21443281pli.104.1529460353524; Tue, 19 Jun 2018 19:05:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529460353; cv=none; d=google.com; s=arc-20160816; b=es/nDtb0FQ1Eu4G/wJnuTsVTgzpCBkGpHHCAlMT7MI4NNgtozxCN3tQVDtkpffT+7z ejrjXudOmnr6X7+8xs1jE5/d2KAJUItnlqwzMoQhbbwSAaWxhXYfpAPhRwUCk6TdCwU7 LqYzUS6/ITyzo9KKw0Ju4gAkqeI0TudZqOeRtuCcg1b4HF3zohqfYEauNTo6gQ0cbhqF ElHYsppesajKAKmMP9cMxUVA4s3PkFzUTEiKfl8g+rZWhy9LllbIRDTYp4UFk+NMUN5G Ja+BSOgJBLZpf2sNUiNbQoXa8DEjNvP/dqJVlek92Ojp/2Qi5/CC/XZhBnMVbcycZ6by km7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=s2QL9Nq0KNy6DJFylKX8IvrJMPAHOXODaIN7p0ra2ow=; b=wpZ2mfTvBtpqKGVFYMcSL/JTFpgXuD3KdlDqmK/TVxLnzBU3C20QJoXxsGWjK1s51a TculA4gTCLiwHtywzaLIV9ihcuG+MMm1X3Yh2Tv3ic3sDlQYlh6WXpkbUTGVT74pIRxN MAI4E3JLnO5pR3oTkdGe/gsqg+kNUFnSAVQLXQm6YVV017mITTpvxuTueO1EW9iVi29r fubQc/ex1NUtEcwJnACwZoMooacFeso5cAMpSX0xP4d1lB7nZkCLdIElku3+ONM530q9 +dTqvgF3BJOh9csH8Xlwm3+jXaB7SwN9A0ErfYZN1bGGDP+qE/QDM/0smD2a56xZIBnT hdfA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r6-v6si1103087pfl.260.2018.06.19.19.05.39; Tue, 19 Jun 2018 19:05:53 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754210AbeFTCEy (ORCPT + 99 others); Tue, 19 Jun 2018 22:04:54 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7809 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753758AbeFTCEv (ORCPT ); Tue, 19 Jun 2018 22:04:51 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1, AES128-SHA) id ; Tue, 19 Jun 2018 19:04:56 -0700 Received: from HQMAIL107.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 19 Jun 2018 19:04:50 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 19 Jun 2018 19:04:50 -0700 Received: from [10.110.48.28] (10.110.48.28) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 20 Jun 2018 02:04:50 +0000 Subject: Re: [PATCH 2/2] mm: set PG_dma_pinned on get_user_pages*() To: Dan Williams CC: Jan Kara , Matthew Wilcox , Christoph Hellwig , Jason Gunthorpe , John Hubbard , Michal Hocko , Christopher Lameter , Linux MM , LKML , linux-rdma References: <311eba48-60f1-b6cc-d001-5cc3ed4d76a9@nvidia.com> <20180618081258.GB16991@lst.de> <3898ef6b-2fa0-e852-a9ac-d904b47320d5@nvidia.com> <0e6053b3-b78c-c8be-4fab-e8555810c732@nvidia.com> <20180619082949.wzoe42wpxsahuitu@quack2.suse.cz> <20180619090255.GA25522@bombadil.infradead.org> <20180619104142.lpilc6esz7w3a54i@quack2.suse.cz> <70001987-3938-d33e-11e0-de5b19ca3bdf@nvidia.com> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Tue, 19 Jun 2018 19:03:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [10.110.48.28] X-ClientProxiedBy: HQMAIL106.nvidia.com (172.18.146.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/19/2018 06:57 PM, Dan Williams wrote: > On Tue, Jun 19, 2018 at 6:34 PM, John Hubbard wrote: >> On 06/19/2018 06:24 PM, Dan Williams wrote: >>> On Tue, Jun 19, 2018 at 11:11 AM, John Hubbard wrote: >>>> On 06/19/2018 03:41 AM, Jan Kara wrote: >>>>> On Tue 19-06-18 02:02:55, Matthew Wilcox wrote: >>>>>> On Tue, Jun 19, 2018 at 10:29:49AM +0200, Jan Kara wrote: >>> [..] >>>>> And then there's the aspect that both these approaches are a bit too >>>>> heavyweight for some get_user_pages_fast() users (e.g. direct IO) - Al Viro >>>>> had an idea to use page lock for that path but e.g. fs/direct-io.c would have >>>>> problems due to lock ordering constraints (filesystem ->get_block would >>>>> suddently get called with the page lock held). But we can probably leave >>>>> performance optimizations for phase two. >>>> >>>> >>>> So I assume that phase one would be to apply this approach only to >>>> get_user_pages_longterm. (Please let me know if that's wrong.) >>> >>> I think that's wrong, because get_user_pages_longterm() is only a >>> filesystem-dax avoidance mechanism, it's not trying to address all the >>> problems that Jan is talking about. I don't see any viable half-step >>> solutions. >>> >> >> OK, but in that case, I'm slightly confused by Jan's comment above, about leaving >> performance optimizations until phase two. Because that *is* a half-step approach: >> phase one, phase two. > > No, sorry, I might be confusing things. The half step is leaving > truncate broken, or my strawman that only addressed unmap. > >> Are you disagreeing with Jan, or are you suggesting "fix get_user_pages first, and >> leave get_user_pages_fast alone for now?" > > I'm agreeing with Jan, we need to fix page_mkclean() and > try_to_unmap() without regressing truncate behavior. > OK, perfect, thanks for clarifying. It all sounds consistent now. :)