Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3135422imj; Mon, 11 Feb 2019 14:41:11 -0800 (PST) X-Google-Smtp-Source: AHgI3IYJY6al8/yjcQnNdkjQBvDPvLtqmYpfFyOEE8JwNLJXWyEHYBfX+3eSaHQcyMmFTVsYYq2b X-Received: by 2002:a17:902:c85:: with SMTP id 5mr600417plt.339.1549924871662; Mon, 11 Feb 2019 14:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549924871; cv=none; d=google.com; s=arc-20160816; b=b1C6Z2Xm6YkNg8qJ4Pu8dNPLTr+ksq2O8ZbSZB7S5Xybw7zrO0tBRJde0DEqsdjhiX wiutVfb4YyFFiTyz7eWadOw+gGZgAlIyuMOFrhPFsV7475t+4CZ9Q5cGyaAg3mG3FlgA 2qASuY85zOceEKhS686pMzwtS8MmlEhdEUtu/0NC0SuxyMOitizcEQx9IQ68t7HmuIYx c9RpK+e9BCHO9aNwGmnqOhkcTrEwiTkqO59qHJ/rkm73ZfL+plKOmb94Dr7zdMni96l9 51ydDfCnhcXQKHaViFAe7o8ih0Dc8HWJL0Fwy1rUXHPGiKwKbev72qfSDOF35aCHPs2Q wSzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=azD7Z5lUcUVIQVfY5HGxu8kHDnUOhVxhCXVHn3D6OuY=; b=TRQtsw6dfzku8Fd4sGx4Qxn6Cs1YMSBgboCEetQ9+jZJaON/MzKiIqU7k/LmXNOT36 bf/tuMySBZh3tdoYZTCz47teBJZ3DNUbQlw3GOCKvbkytR5fhRG80PqdqukR+nBl7YQC 0OwyUZoUbPdHGxrw/Gg+eFswIsLONytGfCf1tCMrYpZjMMo/uX+FdsC8VxLLnD3Xtk9F W8IPLOogofrha9uGEAGIr79ymVfSvU+dXrIq9HpcRAumhb8tOlXnvPA+SB4k00/1FCsI mq5Alh34WuuxPItXZry6LH9kW9C3Sh0arG/r0W2CB2U6zy/5hItTPf4rXMXcNqwnFPr4 rxuA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si10829775pgj.313.2019.02.11.14.40.55; Mon, 11 Feb 2019 14:41:11 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727512AbfBKWkM convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Feb 2019 17:40:12 -0500 Received: from mga17.intel.com ([192.55.52.151]:38976 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726876AbfBKWkM (ORCPT ); Mon, 11 Feb 2019 17:40:12 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2019 14:40:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,360,1544515200"; d="scan'208";a="123707844" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga008.fm.intel.com with ESMTP; 11 Feb 2019 14:40:08 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Feb 2019 14:40:08 -0800 Received: from crsmsx151.amr.corp.intel.com (172.18.7.86) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 11 Feb 2019 14:40:06 -0800 Received: from crsmsx101.amr.corp.intel.com ([169.254.1.57]) by CRSMSX151.amr.corp.intel.com ([169.254.3.79]) with mapi id 14.03.0415.000; Mon, 11 Feb 2019 16:40:03 -0600 From: "Weiny, Ira" To: Jason Gunthorpe CC: "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , Daniel Borkmann , "netdev@vger.kernel.org" , "Marciniszyn, Mike" , "Dalessandro, Dennis" , Doug Ledford , "Andrew Morton" , "Kirill A. Shutemov" , "Williams, Dan J" Subject: RE: [PATCH 0/3] Add gup fast + longterm and use it in HFI1 Thread-Topic: [PATCH 0/3] Add gup fast + longterm and use it in HFI1 Thread-Index: AQHUwkbGJiw3VF3kpESe1yhfT7MilqXbcliAgAADmgD//4l5gIAAkQ8A//+b9cA= Date: Mon, 11 Feb 2019 22:40:02 +0000 Message-ID: <2807E5FD2F6FDA4886F6618EAC48510E79BCF37B@CRSMSX101.amr.corp.intel.com> References: <20190211201643.7599-1-ira.weiny@intel.com> <20190211203417.a2c2kbmjai43flyz@linux-r8p5> <20190211204710.GE24692@ziepe.ca> <20190211214257.GA7891@iweiny-DESK2.sc.intel.com> <20190211222208.GJ24692@ziepe.ca> In-Reply-To: <20190211222208.GJ24692@ziepe.ca> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGMyMmNiMGEtNzUwMC00NDMxLWE1ZmMtNWMwYjg2ZmU5ZDRlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiT2hFSXpPU0p0Mlg2VVJBcFR2RStXWkpkNTRTck9rOXAzR3pXUUF0MytVcXQ2c2VMa28wc2huVkI0ODJEN3lBNiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [172.18.205.10] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mon, Feb 11, 2019 at 01:42:57PM -0800, Ira Weiny wrote: > > On Mon, Feb 11, 2019 at 01:47:10PM -0700, Jason Gunthorpe wrote: > > > On Mon, Feb 11, 2019 at 12:34:17PM -0800, Davidlohr Bueso wrote: > > > > On Mon, 11 Feb 2019, ira.weiny@intel.com wrote: > > > > > Ira Weiny (3): > > > > > mm/gup: Change "write" parameter to flags > > > > > mm/gup: Introduce get_user_pages_fast_longterm() > > > > > IB/HFI1: Use new get_user_pages_fast_longterm() > > > > > > > > Out of curiosity, are you planning on having all rdma drivers use > > > > get_user_pages_fast_longterm()? Ie: > > > > > > > > hw/mthca/mthca_memfree.c: ret = get_user_pages_fast(uaddr & > PAGE_MASK, 1, FOLL_WRITE, pages); > > > > > > This one is certainly a mistake - this should be done with a umem. > > > > It looks like this is mapping a page allocated by user space for a > > doorbell?!?! > > Many drivers do this, the 'doorbell' is a PCI -> CPU thing of some sort My surprise is why does _userspace_ allocate this memory? > > > This does not seem to be allocating memory regions. Jason, do you > > want a patch to just convert these calls and consider it legacy code? > > It needs to use umem like all the other drivers on this path. > Otherwise it doesn't get the page pinning logic right Not sure what you mean regarding the pinning logic? > > There is also something else rotten with these longterm callsites, they seem > to have very different ideas how to handle RLIMIT_MEMLOCK. > > ie vfio doesn't even touch pinned_vm.. and rdma is applying > RLIMIT_MEMLOCK to mm->pinned_vm, while vfio is using locked_vm.. No > idea which is right, but they should be the same, and this pattern should > probably be in core code someplace. Neither do I. But AFAIK pinned_vm is a subset of locked_vm. So should we be accounting both of the counters? Ira