|
|
789f54 |
From 04dce26bd12888b924425beefa449a07b683021a Mon Sep 17 00:00:00 2001
|
|
|
789f54 |
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
|
|
|
789f54 |
Date: Fri, 13 Apr 2018 09:24:30 +0200
|
|
|
789f54 |
Subject: [PATCH] [kernel] Disable gathering /proc/timer* statistics
|
|
|
789f54 |
MIME-Version: 1.0
|
|
|
789f54 |
Content-Type: text/plain; charset=UTF-8
|
|
|
789f54 |
Content-Transfer-Encoding: 8bit
|
|
|
789f54 |
|
|
|
789f54 |
Disable gathering /proc/timer* statistics by default, a new option
|
|
|
789f54 |
'kernel.with-timer' enables gathering these.
|
|
|
789f54 |
|
|
|
789f54 |
If /proc/timer_list is huge, then kernel will experience issues with
|
|
|
789f54 |
processing all the timers since it needs to spin in a tight loop inside
|
|
|
789f54 |
the kernel.
|
|
|
789f54 |
|
|
|
789f54 |
We have tried to fix it from kernel side, added touch_nmi_watchdog() to
|
|
|
789f54 |
silence softlockups, cond_resched() to fix RCU stall issue but with such
|
|
|
789f54 |
huge number of timers the RHEL7 kernel is still hangs.
|
|
|
789f54 |
It can reproduced somehow on upstream kernel (however, there will be
|
|
|
789f54 |
workqueue lockups).
|
|
|
789f54 |
|
|
|
789f54 |
We came to conclusion that reading /proc/timer_list should be disabled
|
|
|
789f54 |
in sosreport. Since /proc/timer_stats is tight to /proc/timer_list, both
|
|
|
789f54 |
are disabled at the same time.
|
|
|
789f54 |
|
|
|
789f54 |
Resolves: #1268
|
|
|
789f54 |
|
|
|
789f54 |
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
|
|
|
789f54 |
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
|
|
|
789f54 |
---
|
|
|
789f54 |
sos/plugins/kernel.py | 10 +++++++++-
|
|
|
789f54 |
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
789f54 |
|
|
|
789f54 |
diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py
|
|
|
789f54 |
index 97ef7862..6c2f509c 100644
|
|
|
789f54 |
--- a/sos/plugins/kernel.py
|
|
|
789f54 |
+++ b/sos/plugins/kernel.py
|
|
|
789f54 |
@@ -27,6 +27,10 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
|
|
|
789f54 |
|
|
|
789f54 |
sys_module = '/sys/module'
|
|
|
789f54 |
|
|
|
789f54 |
+ option_list = [
|
|
|
789f54 |
+ ("with-timer", "gather /proc/timer* statistics", "slow", False)
|
|
|
789f54 |
+ ]
|
|
|
789f54 |
+
|
|
|
789f54 |
def setup(self):
|
|
|
789f54 |
# compat
|
|
|
789f54 |
self.add_cmd_output("uname -a", root_symlink="uname")
|
|
|
789f54 |
@@ -83,7 +87,6 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
|
|
|
789f54 |
"/proc/driver",
|
|
|
789f54 |
"/proc/sys/kernel/tainted",
|
|
|
789f54 |
"/proc/softirqs",
|
|
|
789f54 |
- "/proc/timer*",
|
|
|
789f54 |
"/proc/lock*",
|
|
|
789f54 |
"/proc/misc",
|
|
|
789f54 |
"/var/log/dmesg",
|
|
|
789f54 |
@@ -92,4 +95,9 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
|
|
|
789f54 |
clocksource_path + "current_clocksource"
|
|
|
789f54 |
])
|
|
|
789f54 |
|
|
|
789f54 |
+ if self.get_option("with-timer"):
|
|
|
789f54 |
+ # This can be very slow, depending on the number of timers,
|
|
|
789f54 |
+ # and may also cause softlockups
|
|
|
789f54 |
+ self.add_copy_spec("/proc/timer*")
|
|
|
789f54 |
+
|
|
|
789f54 |
# vim: set et ts=4 sw=4 :
|
|
|
789f54 |
--
|
|
|
789f54 |
2.13.6
|
|
|
789f54 |
|