Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp201870ybr; Fri, 22 May 2020 04:42:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWNu6g02VxuApJyy7i7PsNNfshBFcISWlmCbQeGRiZ4leNKXvmQqWtv+jgILZg1jSwjpDK X-Received: by 2002:a17:906:edb5:: with SMTP id sa21mr7520360ejb.78.1590147756268; Fri, 22 May 2020 04:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590147756; cv=none; d=google.com; s=arc-20160816; b=qm1O0iBQLoUp2lLzsZq/qMDBAYOwnWmAcZ9mTb69YBx4VnUoChiTL4zx6AYm8ZuTLq hLtPOhSqTffgShMf4hi70apEPi1unfQz3TUf/IV5YOrnnCZmqvzy5X8N9HfNdwebOWzG /LFT1yTjb0QTDupvS0OJ/u1FZy+ORUEM/SZXFcLTEPTujpIkdCHW16daPehjWVcCvZil DjmP+gE2Myzf5qUofqT+Gg5/x41E98tDpNd75sBu6mwVmYpCsN2aBPxikhVIxWCmofUf mz1XsWBCkr720TmIHcuBOXD1rRk+SKk6smcqOiRdQIPxScjEqnMVeNUn7NBaMalmTZyP et1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Hj2fTCjbxOKsyZP7M3oTIyRA9mJ2Bc+fUg1m8uH2yYk=; b=c2ndTucfdTbOitLUyJ/r0K2K1KuLP5VP2dXyNyKLmshCtjLRQZa4YM5qvQ8gH/pdZZ oA38kVKaMQq/3uW+RaFR/kSp6FzM8pINS9eqo9lylOjlGeYVqnPqEO+aZ1czSdAo6h2w Zm9F9iibZj3Isf01BMT1CmgT1LivDi3uYiXSgh98bChJivMwdLzVa5VAPcvm1OP1uvDl eri9a9p1hRq7XB0hAuYqAHHSuIzjc5RPhOy6r/Vv2ARQLDdRX2prOeUvZwvvGiYE1blc 93tCPIAD8JwDctRrPhpYPM9vkz56i3Ax+waPYzkZr9jES08TllUbtofdoWUPjJKbmDzQ rFtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Fctbeo2r; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si4415875edf.191.2020.05.22.04.42.13; Fri, 22 May 2020 04:42:36 -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=@gmail.com header.s=20161025 header.b=Fctbeo2r; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729204AbgEVLkq (ORCPT + 99 others); Fri, 22 May 2020 07:40:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728901AbgEVLkp (ORCPT ); Fri, 22 May 2020 07:40:45 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD40C061A0E for ; Fri, 22 May 2020 04:40:45 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id r125so6299768lff.13 for ; Fri, 22 May 2020 04:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Hj2fTCjbxOKsyZP7M3oTIyRA9mJ2Bc+fUg1m8uH2yYk=; b=Fctbeo2rUCXQwGpTpFGVse8+WCb+g1DgkimSxd0aywjWQzd7bhxHHSHfy1FP+QqJ5E HQGcAIndvBPaVq+mvvXrYxa60iZ270cp/hL7v335T389bW5HYMkEi/Mut44zha6NDaG4 UCrNm9pJDDi2UNXl+PlD6bv/w4smxNEG9g8AyCyft6tAOApW/apnSn16+WYKI0WwO/LX QygL+8MKePZCy7xTU8Q+o6DXxVRskTBMwRQQsFJ+VR7QHRA9Pic1hmOdE0dfFierlTBM XmumN0HJD7IHx+R0ZAzFlmPROpUU2YmKdDsZd/Q7eTLT58JceLPdRakROdwY5S4uTJxp Cehw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Hj2fTCjbxOKsyZP7M3oTIyRA9mJ2Bc+fUg1m8uH2yYk=; b=ikks4OUmV7o9J6aw0q4UQuKSvYm8ITAsqpFx7/hveNfHqGGNfYNvX0yS4+RUPOvvgT 9NttISV+1d4JFWlkAgf7khGgY89fpoYWl62TtEc5V6LBnOA63Uob/Ni7/c5ArCHdV/5D IvOJPt01b0qi1OlhD1a5OMZhFInjCMWR/hOhpeSPOY0kHHggz7dyBMRp4P5ZCWTJLChm Zq4NAbEDoAM2wBvKbv6UC12M3Tbngn5TzuXTD90n85DmtBrMOIdVqlhNfEE4juY7N1iO DKvu2bjKi4zPcOxBIi0H8DDM2B0fiCRxyTv6zIdGmmI/buqyd2lMM3BhE1oTCqeF2m5t A0qA== X-Gm-Message-State: AOAM532m4vO1yn2BBhh1ckAvAbxywmZA3cbM+jBZgYW10Si5Q1hmCNGl lRHhXkvEt2EuA3FTU0TrRSv7mXxzkpOTwdCH3zddtI1z X-Received: by 2002:ac2:53a2:: with SMTP id j2mr7071822lfh.139.1590147643673; Fri, 22 May 2020 04:40:43 -0700 (PDT) MIME-Version: 1.0 References: <20200519002124.2025955-1-jhubbard@nvidia.com> In-Reply-To: <20200519002124.2025955-1-jhubbard@nvidia.com> From: Souptick Joarder Date: Fri, 22 May 2020 17:10:32 +0530 Message-ID: Subject: Re: [PATCH 0/4] mm/gup, drm/i915: refactor gup_fast, convert to pin_user_pages() To: John Hubbard Cc: Andrew Morton , Matthew Wilcox , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Tvrtko Ursulin , Matthew Auld , intel-gfx@lists.freedesktop.org, dri-devel , LKML , Linux-MM Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John, On Tue, May 19, 2020 at 5:51 AM John Hubbard wrote: > > 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(). Shall I hold my changes till 5.8-rc1 , when this series will appear upstream ? > > 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 | 150 ++++++++++++-------- > 3 files changed, 107 insertions(+), 68 deletions(-) > > > base-commit: 642b151f45dd54809ea00ecd3976a56c1ec9b53d > -- > 2.26.2 >