Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7150183imu; Thu, 31 Jan 2019 05:53:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN4XICRRjvmHliWcMH0+d7NNZBOksKftZHRot2x1itkhkNUDquk6cTjPJgvbNpdgQNh3LBHr X-Received: by 2002:a63:e84c:: with SMTP id a12mr31116999pgk.241.1548942798549; Thu, 31 Jan 2019 05:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548942798; cv=none; d=google.com; s=arc-20160816; b=aFfPz9mUeqmEGy9RjcBbo9CC+wm4K7D2QMXVpsCGCI+uu8gnQtA1pc2H3NfQRMDiDC 1PmGojvbFob+fzZMZCZoFI42DobnM90DH+AxOEfyDggoYirXowg5+yx95eZhl/rdDAbW uhw4wBz+WT3uURrW+QLPC9yNmZ5rEJxZwQPpBJG3/M04vsMqEkvyjSHWlm2CaLH24IiH 0H+5ZU9W2kkBckqrsONFODfRzDTzafPwyvyjZ7Ao3GcXJsXRjjqKVJESM2mxnLGC6Se5 eimuUw7NBYVr33ESQx/hctXG6zXti2vpPvO6RXVe0bVAl1lLA0+f0owkTxBnaI93z91l cJHw== 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 s5si4328219pgl.481.2019.01.31.05.53.02; Thu, 31 Jan 2019 05:53:18 -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 S1732577AbfAaNwx (ORCPT + 99 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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(-) 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; -- 1.8.3