提交 5926caec 编写于 作者: Z Zhen Lei 提交者: Zheng Zengkai

iommu: set the default iommu-dma mode as non-strict

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4K6DE
CVE: NA

The non-strict smmu mode has significant performance gains and can
resolve the nvme soft lockup problem. We enable it by default.

-----------------------------------------------------

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: NZhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: NXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NZhen Lei <thunder.leizhen@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2bc1b6e1
...@@ -2029,13 +2029,13 @@ ...@@ -2029,13 +2029,13 @@
iommu.strict= [ARM64] Configure TLB invalidation behaviour iommu.strict= [ARM64] Configure TLB invalidation behaviour
Format: { "0" | "1" } Format: { "0" | "1" }
0 - Lazy mode. 0 - Lazy mode (default).
Request that DMA unmap operations use deferred Request that DMA unmap operations use deferred
invalidation of hardware TLBs, for increased invalidation of hardware TLBs, for increased
throughput at the cost of reduced device isolation. throughput at the cost of reduced device isolation.
Will fall back to strict mode if not supported by Will fall back to strict mode if not supported by
the relevant IOMMU driver. the relevant IOMMU driver.
1 - Strict mode (default). 1 - Strict mode.
DMA unmap operations invalidate IOMMU hardware TLBs DMA unmap operations invalidate IOMMU hardware TLBs
synchronously. synchronously.
......
...@@ -29,7 +29,7 @@ static struct kset *iommu_group_kset; ...@@ -29,7 +29,7 @@ static struct kset *iommu_group_kset;
static DEFINE_IDA(iommu_group_ida); static DEFINE_IDA(iommu_group_ida);
static unsigned int iommu_def_domain_type __read_mostly; static unsigned int iommu_def_domain_type __read_mostly;
static bool iommu_dma_strict __read_mostly = true; static bool iommu_dma_strict __read_mostly;
static u32 iommu_cmd_line __read_mostly; static u32 iommu_cmd_line __read_mostly;
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册