From patchwork Thu Jan 31 13:52:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 157142 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp7234801jaa; Thu, 31 Jan 2019 05:52:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN7mQtxKQLDd5FtlJZhObuTQ4tuYmltWOObpAig3PKpYCdLDnsl7LRCU3CA1Hy6pictsvK8Q X-Received: by 2002:a17:902:5ac2:: with SMTP id g2mr35004743plm.313.1548942775123; Thu, 31 Jan 2019 05:52:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548942775; cv=none; d=google.com; s=arc-20160816; b=WIseccoFJI57am2jJwUodeuk0hULP2GGZldULMZC83dgOGh9shRzjurQuxu3LoHLXZ SjVCnznOK2+tmvZD2ziM0VdpuUPpythfOIMOtpeTlnxYfBAMbFfnESZmAXVkGFqjAMqu Gj9QJ3eeFcnAdlHdeQrSDKlVm9yQPVria452/wjTooGwMhWzKAAGVayF//VfaYJtB8eV osKBhE6vnXvL95Zk0VJH8naC0FSvfKqxhQBDAZTveyUb00Al+yX2V7bBLH73HwRrfZSV 2NxdwDZwNPPIHcLVvHyl1HBZJK+DmI7I4RiNYfblypfwQFh9+x+3YOH46XgdqeYsuAQF hhTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=CwhTbnUWvfFSw3Sb5O1XX6Id4y4C5Pxb9NXWhhQyN/Y=; b=HoAdavgotwEbHLPAV2gDPSsUq8G/OzH8FPv/cUaLe+kXElcWK2xztykq9evamd+3Fz BO3Vf3/1cEcDjUT+EpnJ1HKZDsm3mpMvOc6pxgi14eCYl9B77zl0AB9DlFi0vIfAEDiQ 3nLcJ1eELQKA1X4wjcPgSvzMRRkbObcCZLGZrPkhRog3LhU7N66zjxeD94Br3jncr1xp PvG0Htu9p9AS/QYeD/QT4ykZKecAHZIf2+tyLK2baBY2fJelxVi7IphxRqMdoN4btHHT vIx97w1sw5IWxX1vR4WIwFXzoKQ5O+m/Cdwj34D9jwYzAueXHOqWwJH1ulcha4St+img zBRg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si4592528ple.72.2019.01.31.05.52.54; Thu, 31 Jan 2019 05:52:55 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732800AbfAaNwx (ORCPT + 31 others); Thu, 31 Jan 2019 08:52:53 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:45398 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727098AbfAaNww (ORCPT ); Thu, 31 Jan 2019 08:52:52 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D2E2C22D26A4371F7288; Thu, 31 Jan 2019 21:52:50 +0800 (CST) Received: from HGHY1l002753561.china.huawei.com (10.177.23.164) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Thu, 31 Jan 2019 21:52:42 +0800 From: Zhen Lei To: John Garry , Robin Murphy , Will Deacon , Joerg Roedel , linux-arm-kernel , iommu , linux-kernel CC: Zhen Lei , Yunsheng Lin Subject: [PATCH RFC 1/1] iommu: set the default iommu-dma mode as non-strict Date: Thu, 31 Jan 2019 21:52:11 +0800 Message-ID: <20190131135211.6732-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.19.2.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, many peripherals are faster than before. For example, the top speed of the older netcard is 10Gb/s, and now it's more than 25Gb/s. But when iommu page-table mapping enabled, it's hard to reach the top speed in strict mode, because of frequently map and unmap operations. In order to keep abreast of the times, I think it's better to set non-strict as default. Below it's our iperf performance data of 25Gb netcard: strict mode: 18-20 Gb/s non-strict mode: 23.5 Gb/s Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 4 ++-- drivers/iommu/iommu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- 1.8.3 diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index b799bcf..667221f 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -1779,13 +1779,13 @@ iommu.strict= [ARM64] Configure TLB invalidation behaviour Format: { "0" | "1" } - 0 - Lazy mode. + 0 - Lazy mode (default). Request that DMA unmap operations use deferred invalidation of hardware TLBs, for increased throughput at the cost of reduced device isolation. Will fall back to strict mode if not supported by the relevant IOMMU driver. - 1 - Strict mode (default). + 1 - Strict mode. DMA unmap operations invalidate IOMMU hardware TLBs synchronously. diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 3ed4db3..10e0b49 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -43,7 +43,7 @@ #else static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA; #endif -static bool iommu_dma_strict __read_mostly = true; +static bool iommu_dma_strict __read_mostly; struct iommu_callback_data { const struct iommu_ops *ops;