Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3349812imm; Tue, 4 Sep 2018 21:30:37 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZQSTHGY5VprTx+/24ZNLwpt2eycpmy4Iz+v5eYcKBQDCkwukNk2oPwSyZEPRf4GMWM18Ck X-Received: by 2002:a63:3105:: with SMTP id x5-v6mr14192390pgx.323.1536121837536; Tue, 04 Sep 2018 21:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536121837; cv=none; d=google.com; s=arc-20160816; b=aX2hTZeTc0v/DFkT3hvd+ruoQpv/5F433rfsJAqtNHyrq528y8rbFO8R5WgNCZmIqe F/5soUNomvTDtBYVfvU8Q+c9yU4fJaxIa8Jt50gi45/1vmgFoaGf9989OQbPbR56GmhL lzpLoPHgsPeGZwv8XNBlh5Ofz+Crxw1KvH9jy6Pb0y4eYf0G64htgZ60/tl1xkCYJbtD RtBqcE3INiCssAQChtw/R8ouR5MBdgy5bJsD7qoCwG7epCsy8thT49kKlwmB9rU8G4bw tIGQVTS/P0UkTp8sXREDslsh5bHUbraCQ0k8N5j168l5JCeijlov6CVzBeWV8WSsrRgy LT6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=vqk7yimcksjabWgAgaPRayHI7eF/49oLEJCgmaObcD8=; b=oYku23bZxW6nKr9s8A0cIhf9OxzJGMnzsgnPMywFT5CLycbeHOPp6Xu1+AvOdcjBtL D2L/EoUbWHIoznPyh+XZWbrhNLql0ZVdmoOJ4cDydKEDbukv2Ru/9a95xTJlkY4uGpcv +yYZsH0Z4SLHWIwd3+2Sr/8HpCIOYpXwxwo9+yeu6wjtCXuv7qccVoPNsURMP2pe2aRW jpooIlz9fG3Qxs3fEjs+ryXkd+5GCLa+FKZI6Mcnztdcvw6Wn/96HyVZ+q8SUutrgK6G DntcYl1gSrCO2MLejmSjqTSwIU6imUKJRt/XPsTVuL//ngSgV5cwCWvZkjBUcjzg17mP FlkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=KYeykfUK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10-v6si926784pfc.51.2018.09.04.21.30.08; Tue, 04 Sep 2018 21:30:37 -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; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=KYeykfUK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727489AbeIEI4d (ORCPT + 99 others); Wed, 5 Sep 2018 04:56:33 -0400 Received: from mail-eopbgr710071.outbound.protection.outlook.com ([40.107.71.71]:2814 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726474AbeIEI4c (ORCPT ); Wed, 5 Sep 2018 04:56:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vqk7yimcksjabWgAgaPRayHI7eF/49oLEJCgmaObcD8=; b=KYeykfUKIamrm6Q74DOg9L2uWCSXe6Pjm783cc70/dwrDT48aRQ6EM7w+1C/exTbZiC3GaxbCSIDFxzt+tQT+tdUUaw2gw178q4dehTF0Te+UryxoDEzvWgie3/b0o0baRkxKeKBRIuUY+F9ceI1jS/qoYmGKwCD2mxI0g0GGFo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ganapatrao.Kulkarni@cavium.com; Received: from mypc.cavium.com.com (111.93.218.67) by DM6PR07MB5306.namprd07.prod.outlook.com (2603:10b6:5:45::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.18; Wed, 5 Sep 2018 04:28:08 +0000 From: Ganapatrao Kulkarni To: joro@8bytes.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, robin.murphy@arm.com Cc: tomasz.nowicki@cavium.com, jnair@caviumnetworks.com, Robert.Richter@cavium.com, Vadim.Lomovtsev@cavium.com, Jan.Glauber@cavium.com, gklkml16@gmail.com Subject: [PATCH v4] iommu/iova: Optimise attempts to allocate iova from 32bit address range Date: Wed, 5 Sep 2018 09:57:36 +0530 Message-Id: <20180905042736.11904-1-ganapatrao.kulkarni@cavium.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR0101CA0066.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:d::28) To DM6PR07MB5306.namprd07.prod.outlook.com (2603:10b6:5:45::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 156d6773-55c4-41cc-4dad-08d612e7fd73 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:DM6PR07MB5306; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB5306;3:1rraQKxipT3uaCaUqG1NcairU7zejxwoEX5p3NKiV9LQl6P84H4oEie79q4C2JXJ7nFdnrh51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eFq0ZxaFELRZiFcYommyApbinB3bFxmUjqrrOJRvwUgJ0Yh3HGA0/CjTkcIpZQNdFd1z2+KhVNq5ELJ3efe2Lsf1wCU5RI2Ci3WpNVs7GNMPjrzdlSo1yeBtD/bIaf8GMTmTCXQ5ukDLh0i1+8O2e42iuklernfBEBAySUM0J891JZCkEipdVjMORAtKDARRKUsAg79rjwk4L+A1aYiRJfytmjpoKsP7ZfLX/L3W5ZBZFad7ePph5cXm6mKkh6eXXYKQ4ggrydMwD2SJSZ9dyorf9;4:mzlVW1MBxFpUI7+20KG5llyRvF1unxcs1tcNGZI8ArEMm8rvvO87FJYAsrsbRnpoPQsK7ZeLkec2bBJfsf6n1l1zRNR1xriQqYQrcjdsbsE8J9f87wN2grKfSSBYQyo1AiiaSpwYMM4n1S5Vq3b9TNI0NB9UrFETx5d3w+dE/MNIymy03rcisPdnQvhpFC2wS9HsemUJ80V7zyMwkKXsScYbnwSJ8NCwAutFMt6eFyKa+8lJ82KtJYsMOZjA18aVb+ktEXhtxWCk9WLxFMV96Xq0Vq7yyh9OSAUqLUWzktcW3CXmCuwGVMkLFQQAcyq0HTPFWR1VLV6MrkNh0zFp/uqOZI46g8Kc+Ebcy5QQyD8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(269456686620040); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699016);SRVR:DM6PR07MB5306;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB5306; X-Forefront-PRVS: 078693968A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(39860400002)(376002)(136003)(396003)(366004)(189003)(199004)(50226002)(8936002)(97736004)(81166006)(4326008)(36756003)(486006)(68736007)(105586002)(25786009)(106356001)(6666003)(5660300001)(48376002)(6486002)(39060400002)(478600001)(44832011)(72206003)(16586007)(316002)(47776003)(8676002)(52116002)(7696005)(5009440100003)(66066001)(6512007)(6306002)(51416003)(966005)(186003)(1076002)(81156014)(7736002)(6506007)(305945005)(6116002)(3846002)(53936002)(476003)(14444005)(86362001)(16526019)(26005)(2616005)(956004)(50466002)(386003)(2906002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB5306;H:mypc.cavium.com.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM6PR07MB5306;23:QYzlFD/DNpB03Hl34ediL1BclRTpymXpJhG1spR3u?= =?us-ascii?Q?TP24Avq9LCcMB82Qvk4toamkgmpWpB17ukbYz5ieP8JAYXD0Ft75ECCTFukr?= =?us-ascii?Q?kb8EuACW1i2E26gmJpxxqYlZUNFs8AqQygq1AVW2BKDqRzt8Lpf56CmB2iIb?= =?us-ascii?Q?KjnhPHzbmTnfe2I8w0xZX+PO1YodmC5zQGC/Y8KBeppblgp9kKJlfUMPiFNi?= =?us-ascii?Q?HypTwmE639VVRYVgWKcJyLeMRpljyBZaKdgoY4fhDXoKPtqjTFqhTKoop65R?= =?us-ascii?Q?B7cVKXGZfoWby2CRzQsJteCAPibLSKGHBGJVbCU/JLEOmwWY9DFr56LAQAum?= =?us-ascii?Q?2btgLsDuIkOIRd+gEyUkDvEsu7o9Ss05uutQbXR/fTwdL1b0b7GP32sY6EKd?= =?us-ascii?Q?9fy+PCy21qcGIO2qBKNdRlCpa8JhI70QD06yLHTtsSm1B7npOqGF9TfHOujn?= =?us-ascii?Q?cZuQ1U8fj8pYn6d0uaiydLlrP3pmUfGnv4/O77qN7baBplnSA1jjxIUSKb+v?= =?us-ascii?Q?imHtm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yuLd7N6RMNlX7wkjfY+ZinGoVb3/7u9G0VlcPHr6qbCjr3+tabcrph4A+5gPRGClaUJRmh4SI2ATvF4kA0qULla3mV/60ZCS4f1oOD5f9biMTdkeYCnkCIxIY+C/ZUi4SCytfJt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2018 04:28:08.7816 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 156d6773-55c4-41cc-4dad-08d612e7fd73 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB5306 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As an optimisation for PCI devices, there is always first attempt been made to allocate iova from SAC address range. This will lead to unnecessary attempts, when there are no free ranges available. Adding fix to track recently failed iova address size and allow further attempts, only if requested size is lesser than a failed size. The size is updated when any replenish happens. Reviewed-by: Robin Murphy Signed-off-by: Ganapatrao Kulkarni --- v4: Rebsaed to 4.19-rc2 v3: Update with comments [3] from Robin Murphy [3] https://lkml.org/lkml/2018/8/13/116 v2: update with comments [2] from Robin Murphy [2] https://lkml.org/lkml/2018/8/7/166 v1: Based on comments from Robin Murphy for patch [1] [1] https://lkml.org/lkml/2018/4/19/780 drivers/iommu/iova.c | 22 +++++++++++++++------- include/linux/iova.h | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c index 83fe2621effe..f8d3ba247523 100644 --- a/drivers/iommu/iova.c +++ b/drivers/iommu/iova.c @@ -56,6 +56,7 @@ init_iova_domain(struct iova_domain *iovad, unsigned long granule, iovad->granule = granule; iovad->start_pfn = start_pfn; iovad->dma_32bit_pfn = 1UL << (32 - iova_shift(iovad)); + iovad->max32_alloc_size = iovad->dma_32bit_pfn; iovad->flush_cb = NULL; iovad->fq = NULL; iovad->anchor.pfn_lo = iovad->anchor.pfn_hi = IOVA_ANCHOR; @@ -139,8 +140,10 @@ __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova *free) cached_iova = rb_entry(iovad->cached32_node, struct iova, node); if (free->pfn_hi < iovad->dma_32bit_pfn && - free->pfn_lo >= cached_iova->pfn_lo) + free->pfn_lo >= cached_iova->pfn_lo) { iovad->cached32_node = rb_next(&free->node); + iovad->max32_alloc_size = iovad->dma_32bit_pfn; + } cached_iova = rb_entry(iovad->cached_node, struct iova, node); if (free->pfn_lo >= cached_iova->pfn_lo) @@ -190,6 +193,10 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, /* Walk the tree backwards */ spin_lock_irqsave(&iovad->iova_rbtree_lock, flags); + if (limit_pfn <= iovad->dma_32bit_pfn && + size >= iovad->max32_alloc_size) + goto iova32_full; + curr = __get_cached_rbnode(iovad, limit_pfn); curr_iova = rb_entry(curr, struct iova, node); do { @@ -200,10 +207,8 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, curr_iova = rb_entry(curr, struct iova, node); } while (curr && new_pfn <= curr_iova->pfn_hi); - if (limit_pfn < size || new_pfn < iovad->start_pfn) { - spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); - return -ENOMEM; - } + if (limit_pfn < size || new_pfn < iovad->start_pfn) + goto iova32_full; /* pfn_lo will point to size aligned address if size_aligned is set */ new->pfn_lo = new_pfn; @@ -214,9 +219,12 @@ static int __alloc_and_insert_iova_range(struct iova_domain *iovad, __cached_rbnode_insert_update(iovad, new); spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); - - return 0; + +iova32_full: + iovad->max32_alloc_size = size; + spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags); + return -ENOMEM; } static struct kmem_cache *iova_cache; diff --git a/include/linux/iova.h b/include/linux/iova.h index 928442dda565..0b93bf96693e 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h @@ -75,6 +75,7 @@ struct iova_domain { unsigned long granule; /* pfn granularity for this domain */ unsigned long start_pfn; /* Lower limit for this domain */ unsigned long dma_32bit_pfn; + unsigned long max32_alloc_size; /* Size of last failed allocation */ struct iova anchor; /* rbtree lookup anchor */ struct iova_rcache rcaches[IOVA_RANGE_CACHE_MAX_SIZE]; /* IOVA range caches */ -- 2.18.0