提交 4445f2dd 编写于 作者: X Xie XiuQi

arm64: defconfig: enable fine-grained task level IRQ time accounting

hulk inclusion
category: feature
bugzilla: 13257
CVE: NA

Patch 168f2a8045 (arm64: defconfig: enable fine-grained task level IRQ
time accounting) enable CONFIG_IRQ_TIME_ACCOUNTING by default. And we meet
cpu usage problem in product team. So enable it on kernel by default.

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

Tests showed, that under certain conditions, the summary number of jiffies
spent on softirq/idle, which are counted by system statistics can be even
below 10% of expected value, resulting in false load presentation.

The issue was observed on the quad-core Marvell Armada 8k SoC, whose two
10G ports were bound into L2 bridge. Load was controlled by bidirectional
UDP traffic, produced by a packet generator. Under such condition,
the dominant load is softirq. With 100% single CPU occupation or without
any activity (all CPUs 100% idle), total number of jiffies is 10000 (2500
per each core) in 10s interval. Also with other kind of load this was
true.

However below a saturation threshold it was observed, that with CPU which
was occupied almost by softirqs only, the statistic were awkward. See
the mpstat output:

CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
all 0.00  0.00 0.13    0.00 0.00  0.55   0.00   0.00   0.00 99.32
0 0.00  0.00 0.00    0.00 0.00 23.08   0.00   0.00   0.00 76.92
1 0.00  0.00 0.40    0.00 0.00  0.00   0.00   0.00   0.00 99.60
2 0.00  0.00 0.00    0.00 0.00  0.00   0.00   0.00   0.00 100.00
3 0.00  0.00 0.00    0.00 0.00  0.00   0.00   0.00   0.00 100.00

Above would mean basically no total load, debug CPU0 occupied in 25%.
Raw statistics, printed every 10s from /proc/stat unveiled a root
cause - summary idle/softirq jiffies on loaded CPU were below 200,
i.e. over 90% samples lost. All problems were gone after enabling
fine granulity IRQ time accounting.

This patch fixes possible wrong statistics processing by enabling
CONFIG_IRQ_TIME_ACCOUNTING for arm64 platfroms, which is by
default done on other architectures, e.g. x86 and arm. Tests
showed no noticeable performance penalty, nor stability impact.
Signed-off-by: NMarcin Wojtas <mw@semihalf.com>
Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
[XQ: enable this config on hulk_defconfig]
Signed-off-by: NXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ad6a0d7a
...@@ -79,7 +79,7 @@ CONFIG_PREEMPT_VOLUNTARY=y ...@@ -79,7 +79,7 @@ CONFIG_PREEMPT_VOLUNTARY=y
# #
CONFIG_VIRT_CPU_ACCOUNTING=y CONFIG_VIRT_CPU_ACCOUNTING=y
CONFIG_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_VIRT_CPU_ACCOUNTING_GEN=y
# CONFIG_IRQ_TIME_ACCOUNTING is not set CONFIG_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_SCHED_AVG_IRQ=y CONFIG_HAVE_SCHED_AVG_IRQ=y
CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT=y
CONFIG_BSD_PROCESS_ACCT_V3=y CONFIG_BSD_PROCESS_ACCT_V3=y
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册