Message ID | 20211020185207.18509-1-ankur.a.arora@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <SRS0=02Vf=PI=kvack.org=owner-linux-mm@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDBD0C433F5 for <linux-mm@archiver.kernel.org>; Wed, 20 Oct 2021 18:52:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7C85E610D0 for <linux-mm@archiver.kernel.org>; Wed, 20 Oct 2021 18:52:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7C85E610D0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 190F494000B; Wed, 20 Oct 2021 14:52:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 13FE96B007E; Wed, 20 Oct 2021 14:52:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0074494000B; Wed, 20 Oct 2021 14:52:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E76CA6B007D for <linux-mm@kvack.org>; Wed, 20 Oct 2021 14:52:49 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9C75D8249980 for <linux-mm@kvack.org>; Wed, 20 Oct 2021 18:52:49 +0000 (UTC) X-FDA: 78717712458.25.453BE5C Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 5A429B0000A3 for <linux-mm@kvack.org>; Wed, 20 Oct 2021 18:52:46 +0000 (UTC) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19KIVkgC025798; Wed, 20 Oct 2021 18:52:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=corp-2021-07-09; bh=LiE9WJoftzY3Rn6Hlp/Im0DVv0DI2FTmT5imqp7DQyQ=; b=SCcnCfmHJIPEcuR8kAUBefoSAB5spoNBTMWzu1OBfn4QIV6CNTNzGQxLiiyf4ildo8Q8 nRE0R0maeF2egvXDZqO9Ngg+Jupvp+q10UyfSL/3DBSzBl8dwXORQi/v2L724CVR2WFx nFDlqRb3PX33B9Tm5gWWp5fLXq5yhEIK1SCCdH8PZyZjIqt3HGbKcgVNFfQ0E1I/p+c7 UzcH1Cpll/6TeOf3W6IhRfaR2aUiyvpXz6uw1+Jv1mnq0p+8JvVTnJ1ijuzaIormmgqp pm4o5CWZLc4iEaiy0XhUOTSoLPON1cEQgeIE2nQRhtOItfnlYM9tvRvgScpthX7uHJY6 SQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3btrfm0418-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Oct 2021 18:52:43 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 19KIpb3F052811; Wed, 20 Oct 2021 18:52:42 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3030.oracle.com with ESMTP id 3bqkv0hh8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Oct 2021 18:52:42 +0000 Received: from userp3030.oracle.com (userp3030.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 19KIqfwq059818; Wed, 20 Oct 2021 18:52:41 GMT Received: from monad.us.oracle.com (dhcp-10-159-132-124.vpn.oracle.com [10.159.132.124]) by userp3030.oracle.com with ESMTP id 3bqkv0hh7s-1; Wed, 20 Oct 2021 18:52:41 +0000 From: Ankur Arora <ankur.a.arora@oracle.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org Cc: mingo@kernel.org, bp@alien8.de, luto@kernel.org, akpm@linux-foundation.org, mike.kravetz@oracle.com, jon.grimm@amd.com, kvm@vger.kernel.org, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, Ankur Arora <ankur.a.arora@oracle.com>, alex.williamson@redhat.com Subject: [PATCH v2 13/14] vfio_iommu_type1: specify FOLL_HINT_BULK to pin_user_pages() Date: Wed, 20 Oct 2021 11:52:07 -0700 Message-Id: <20211020185207.18509-1-ankur.a.arora@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211020170305.376118-1-ankur.a.arora@oracle.com> References: <20211020170305.376118-1-ankur.a.arora@oracle.com> MIME-Version: 1.0 X-Proofpoint-GUID: kyJVys3aFUyKJefJejJSe5ZCKu_C4bvd X-Proofpoint-ORIG-GUID: kyJVys3aFUyKJefJejJSe5ZCKu_C4bvd X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 5A429B0000A3 X-Stat-Signature: s748tccd5gonumtjfgr7c495kb7jyemg Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2021-07-09 header.b=SCcnCfmH; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf19.hostedemail.com: domain of ankur.a.arora@oracle.com has no SPF policy when checking 205.220.177.32) smtp.mailfrom=ankur.a.arora@oracle.com X-HE-Tag: 1634755966-601453 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Use uncached stores while clearing huge pages
|
expand
|
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 0e9217687f5c..0d45b0c6464d 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -557,6 +557,9 @@ static int vaddr_get_pfns(struct mm_struct *mm, unsigned long vaddr, if (prot & IOMMU_WRITE) flags |= FOLL_WRITE; + /* Tell gup that this iterations is part of larger set of pins. */ + flags |= FOLL_HINT_BULK; + mmap_read_lock(mm); ret = pin_user_pages_remote(mm, vaddr, npages, flags | FOLL_LONGTERM, pages, NULL, NULL);
Specify FOLL_HINT_BULK to pin_user_pages() so it is aware that this pin is part of a larger region being pinned, so it can optimize based on that expectation. Cc: alex.williamson@redhat.com Signed-off-by: Ankur Arora <ankur.a.arora@oracle.com> --- drivers/vfio/vfio_iommu_type1.c | 3 +++ 1 file changed, 3 insertions(+)