提交 d1473d2a 编写于 作者: J Jinyu Qi 提交者: Xie XiuQi

iommu/iova: Separate atomic variables to improve performance

mainline inclusion
from linux-next
commit: 14bd9a607f9082e7b5690c27e69072f2aeae0de4
category: feature
feature: IOMMU performance
bugzilla: NA
CVE: NA

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

In struct iova_domain, there are three atomic variables, the former two
are about TLB flush counters which use atomic_add operation, anoter is
used to flush timer that use cmpxhg operation.
These variables are in the same cache line, so it will cause some
performance loss under the condition that many cores call queue_iova
function, Let's isolate the two type atomic variables to different
cache line to reduce cache line conflict.

Cc: Joerg Roedel <joro@8bytes.org>
Signed-off-by: NJinyu Qi <jinyuqi@huawei.com>
Signed-off-by: NJoerg Roedel <jroedel@suse.de>
Signed-off-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 42a55ea3
...@@ -76,6 +76,14 @@ struct iova_domain { ...@@ -76,6 +76,14 @@ struct iova_domain {
unsigned long start_pfn; /* Lower limit for this domain */ unsigned long start_pfn; /* Lower limit for this domain */
unsigned long dma_32bit_pfn; unsigned long dma_32bit_pfn;
unsigned long max32_alloc_size; /* Size of last failed allocation */ unsigned long max32_alloc_size; /* Size of last failed allocation */
struct iova_fq __percpu *fq; /* Flush Queue */
atomic64_t fq_flush_start_cnt; /* Number of TLB flushes that
have been started */
atomic64_t fq_flush_finish_cnt; /* Number of TLB flushes that
have been finished */
struct iova anchor; /* rbtree lookup anchor */ struct iova anchor; /* rbtree lookup anchor */
struct iova_rcache rcaches[IOVA_RANGE_CACHE_MAX_SIZE]; /* IOVA range caches */ struct iova_rcache rcaches[IOVA_RANGE_CACHE_MAX_SIZE]; /* IOVA range caches */
...@@ -85,14 +93,6 @@ struct iova_domain { ...@@ -85,14 +93,6 @@ struct iova_domain {
iova_entry_dtor entry_dtor; /* IOMMU driver specific destructor for iova_entry_dtor entry_dtor; /* IOMMU driver specific destructor for
iova entry */ iova entry */
struct iova_fq __percpu *fq; /* Flush Queue */
atomic64_t fq_flush_start_cnt; /* Number of TLB flushes that
have been started */
atomic64_t fq_flush_finish_cnt; /* Number of TLB flushes that
have been finished */
struct timer_list fq_timer; /* Timer to regularily empty the struct timer_list fq_timer; /* Timer to regularily empty the
flush-queues */ flush-queues */
atomic_t fq_timer_on; /* 1 when timer is active, 0 atomic_t fq_timer_on; /* 1 when timer is active, 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册