Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1994317ybk; Thu, 21 May 2020 22:21:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu3jOjQl5HtF8dICRxSzBRQdUOoW6BcRCqx1YVX2lV7wKrJWUrXyusDiXBnsMyhXgh0p4K X-Received: by 2002:a17:906:68d2:: with SMTP id y18mr6774405ejr.248.1590124897945; Thu, 21 May 2020 22:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590124897; cv=none; d=google.com; s=arc-20160816; b=LI+3YKxeknwqILzkmZhUOO2mBPj6KXKNC7kpwcHaJanX+Xho/X2QBERagbljlwYpNW 9WByVyTc51LnxnhnNNDrEvFwnSu8g/7KJGLlZRN6H4Z90KbXx6t8lMmHnU/quRNMMmHA S3rxzJ1Ud+YeuLwtHZ4OmMCBvvwWJlKjVpFqmi4eQh3MTok03d75GCkoKZLPXR3PS6jO qLmQbQUsstey3jrer8WUzhcF+lHvh0NSJtHqps7baRb1o61FlfJHEewWJeKnshKfVitA J8z94zE0NEezl5F6vUF5CydduulXFh6/xnTGzvyNkhu/IcVR7ysIY6nNtNJBcwK/2C/G TY/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=hhCuG4lTr8DGvhmADVoRUDXJfb9QfkbC0ipkPVPTT7E=; b=wYXLa8S57lU08lKRaOw/9LiqYueqdIUUxkIBg4KboEtwWvH5OfTm2ROVNBBs8pgs/4 AnicP/VFtvh61RNrg10ww/GGq5QBE0Fy/2BBqH9JOLWdPvMe940ZS66SxNiHxU1T6Uq3 Qf6TnrBK8v/EGNekuNFrjpLVZH/pOsKm1tE623JnXuUnnxjgkVjVyYv/yAR2B1HnKDjG bx2p/oZ4R+eb/3z8fIEIQboQ0zPH8w20ZeQnVf9W91fVzmGopW+y+HoH0yGh/gqcMBeK BeP9OIpSiQ1BBb5INFKTNyQLF8/ftABmQjkwfdnRAIp7xtWNXUcVuiM8+rOlKN58MjHc GtrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=FdOAmhGr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si4655261ejb.314.2020.05.21.22.21.15; Thu, 21 May 2020 22:21:37 -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=@nvidia.com header.s=n1 header.b=FdOAmhGr; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728214AbgEVFTg (ORCPT + 99 others); Fri, 22 May 2020 01:19:36 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:6834 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728187AbgEVFTe (ORCPT ); Fri, 22 May 2020 01:19:34 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 21 May 2020 22:17:08 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 21 May 2020 22:19:33 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 21 May 2020 22:19:33 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 22 May 2020 05:19:32 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 22 May 2020 05:19:32 +0000 Received: from sandstorm.nvidia.com (Not Verified[10.2.48.182]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Thu, 21 May 2020 22:19:32 -0700 From: John Hubbard To: Andrew Morton CC: Souptick Joarder , Matthew Wilcox , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Tvrtko Ursulin , Matthew Auld , , , LKML , , John Hubbard Subject: [PATCH v2 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages() Date: Thu, 21 May 2020 22:19:27 -0700 Message-ID: <20200522051931.54191-1-jhubbard@nvidia.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1590124628; bh=hhCuG4lTr8DGvhmADVoRUDXJfb9QfkbC0ipkPVPTT7E=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: MIME-Version:X-NVConfidentiality:Content-Transfer-Encoding: Content-Type; b=FdOAmhGrmXVMJza0Fp11gi+KN7tPFZCcxwJ84N3GZOaBBjhCcAkKDPUSALSQYikAU MzT0Zbeo5nS3tAjstxwkYQ8FA8wrGmkUzrf9deBBmgnpmHBkK5mydRsXFWDPKBnudG p1GvWq8+hVB3Bl9d9Tr47KvpTBKuS9fU3pJqPA4pNQxhqQ3ESaHIIOeURRW+rbP6Ua kmolkd/z3pcX2mE9bz5e1E4P40PUlMtpjg+SKJN75igFfPsWSdJiAoU+IyFynQ93uQ pqb8YqUVrl+Fa97koH4oxUZEg0J7tk5+Y2oIeWBII3a+M8IXtIAIh79z60ir5gA5BI 2SVPpX0yT9bHQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The purpose of posting this series is to launch a test in the intel-gfx-ci tree. (The patches have already been merged into Andrew's linux-mm tree.) This applies to today's linux.git (note the base-commit tag at the bottom). Changes since V1: * Fixed a bug in the refactoring patch: added FOLL_FAST_ONLY to the list of gup_flags *not* to WARN() on. This lead to a failure in the first intel-gfx-ci test run [1]. [1] https://lore.kernel.org/r/159008745422.32320.5724805750977048669@build.= alporthouse.com Original cover letter: This needs to go through Andrew's -mm tree, due to adding a new gup.c routine. However, I would really love to have some testing from the drm/i915 folks, because I haven't been able to run-time test that part of it. Otherwise, though, the series has passed my basic run time testing: some LTP tests, some xfs and etx4 non-destructive xfstests, and an assortment of other smaller ones: vm selftests, io_uring_register, a few more. But that's only on one particular machine. Also, cross-compile tests for half a dozen arches all pass. Details: In order to convert the drm/i915 driver from get_user_pages() to pin_user_pages(), a FOLL_PIN equivalent of __get_user_pages_fast() was required. That led to refactoring __get_user_pages_fast(), with the following goals: 1) As above: provide a pin_user_pages*() routine for drm/i915 to call, in place of __get_user_pages_fast(), 2) Get rid of the gup.c duplicate code for walking page tables with interrupts disabled. This duplicate code is a minor maintenance problem anyway. 3) Make it easy for an upcoming patch from Souptick, which aims to convert __get_user_pages_fast() to use a gup_flags argument, instead of a bool writeable arg. Also, if this series looks good, we can ask Souptick to change the name as well, to whatever the consensus is. My initial recommendation is: get_user_pages_fast_only(), to match the new pin_user_pages_only(). John Hubbard (4): mm/gup: move __get_user_pages_fast() down a few lines in gup.c mm/gup: refactor and de-duplicate gup_fast() code mm/gup: introduce pin_user_pages_fast_only() drm/i915: convert get_user_pages() --> pin_user_pages() drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 22 +-- include/linux/mm.h | 3 + mm/gup.c | 153 ++++++++++++-------- 3 files changed, 109 insertions(+), 69 deletions(-) base-commit: 051143e1602d90ea71887d92363edd539d411de5 --=20 2.26.2