* [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks
@ 2025-11-17 4:57 cx19970
2025-11-17 7:40 ` kernel test robot
2025-11-17 8:02 ` kernel test robot
0 siblings, 2 replies; 3+ messages in thread
From: cx19970 @ 2025-11-17 4:57 UTC (permalink / raw)
To: mingo, peterz, juri.lelli, vincent.guittot
Cc: dietmar.eggemann, rostedt, bsegall, mgorman, vschneid,
linux-kernel, cx19970
When the number of processes in the system is extremely large,
manually execute the "sysrq-t" command and print the task list
information on the serial port. The kernel will experience a soft lockup.
You need to manually press the keys to input the "sysrq-t" command,
that is: the "BREAK" key + the "t" key.
For X86 devices with the 8250 serial port, the baud rate is 115200,
and the response duration of "sysrq-t" will exceed 30 minutes.
The key factors causing the soft lock problem:
1.Too many processes.
2.Serial port printing is too slow.
3.The default timeout of the kernel watchdog is 20 seconds, which is too short.
4.The kernel task list "task" is too long.
5.The kernel scheduling queue "cfs_rq" is too long.
6.Exclusive CPU core during sysrq-t.
7.There is too much content to be printed during sysrq-t.
8.Reading cpuinfo requires inter-core communication.
Solution: Add the operation of resetting the watchdog when printing the
task list "task" and the scheduling queue "cfs_rq" using sysrq-t.
Signed-off-by: cx19970 <cx19970@qq.com>
---
kernel/sched/debug.c | 2 ++
kernel/sched/fair.c | 5 ++++-
kernel/sched/rt.c | 5 ++++-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
index 02e16b70a790..f3d8df4f8490 100644
--- a/kernel/sched/debug.c
+++ b/kernel/sched/debug.c
@@ -789,6 +789,8 @@ static void print_rq(struct seq_file *m, struct rq *rq, int rq_cpu)
if (task_cpu(p) != rq_cpu)
continue;
+ touch_nmi_watchdog();
+ touch_all_softlockup_watchdogs();
print_task(m, rq, p);
}
rcu_read_unlock();
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5b752324270b..0e93054d2c46 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -13672,8 +13672,11 @@ void print_cfs_stats(struct seq_file *m, int cpu)
struct cfs_rq *cfs_rq, *pos;
rcu_read_lock();
- for_each_leaf_cfs_rq_safe(cpu_rq(cpu), cfs_rq, pos)
+ for_each_leaf_cfs_rq_safe(cpu_rq(cpu), cfs_rq, pos) {
+ touch_nmi_watchdog();
+ touch_all_softlockup_watchdogs();
print_cfs_rq(m, cpu, cfs_rq);
+ }
rcu_read_unlock();
}
diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index 7936d4333731..46ac5ddc5071 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2932,7 +2932,10 @@ void print_rt_stats(struct seq_file *m, int cpu)
struct rt_rq *rt_rq;
rcu_read_lock();
- for_each_rt_rq(rt_rq, iter, cpu_rq(cpu))
+ for_each_rt_rq(rt_rq, iter, cpu_rq(cpu)) {
+ touch_nmi_watchdog();
+ touch_all_softlockup_watchdogs();
print_rt_rq(m, cpu, rt_rq);
+ }
rcu_read_unlock();
}
--
2.36.1.windows.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks
2025-11-17 4:57 [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks cx19970
@ 2025-11-17 7:40 ` kernel test robot
2025-11-17 8:02 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-11-17 7:40 UTC (permalink / raw)
To: cx19970, mingo, peterz, juri.lelli, vincent.guittot
Cc: oe-kbuild-all, dietmar.eggemann, rostedt, bsegall, mgorman,
vschneid, linux-kernel, cx19970
Hi cx19970,
kernel test robot noticed the following build errors:
[auto build test ERROR on tip/sched/core]
[also build test ERROR on linus/master v6.18-rc6 next-20251114]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/cx19970/BUG-sysrq-Reset-the-watchdog-during-the-polling-of-sysrq-t-processing-tasks/20251117-130012
base: tip/sched/core
patch link: https://lore.kernel.org/r/tencent_B7DDA306E3B6A8CDF3195E4C083C9BD37E07%40qq.com
patch subject: [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks
config: i386-allnoconfig (https://download.01.org/0day-ci/archive/20251117/202511171515.bQfhqZLh-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251117/202511171515.bQfhqZLh-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511171515.bQfhqZLh-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/sched/fair.c: In function 'print_cfs_stats':
>> kernel/sched/fair.c:13940:17: error: implicit declaration of function 'touch_nmi_watchdog' [-Wimplicit-function-declaration]
13940 | touch_nmi_watchdog();
| ^~~~~~~~~~~~~~~~~~
>> kernel/sched/fair.c:13941:17: error: implicit declaration of function 'touch_all_softlockup_watchdogs' [-Wimplicit-function-declaration]
13941 | touch_all_softlockup_watchdogs();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from kernel/sched/build_policy.c:52:
kernel/sched/rt.c: In function 'print_rt_stats':
>> kernel/sched/rt.c:2941:17: error: implicit declaration of function 'touch_nmi_watchdog' [-Wimplicit-function-declaration]
2941 | touch_nmi_watchdog();
| ^~~~~~~~~~~~~~~~~~
>> kernel/sched/rt.c:2942:17: error: implicit declaration of function 'touch_all_softlockup_watchdogs' [-Wimplicit-function-declaration]
2942 | touch_all_softlockup_watchdogs();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/touch_nmi_watchdog +13940 kernel/sched/fair.c
13933
13934 void print_cfs_stats(struct seq_file *m, int cpu)
13935 {
13936 struct cfs_rq *cfs_rq, *pos;
13937
13938 rcu_read_lock();
13939 for_each_leaf_cfs_rq_safe(cpu_rq(cpu), cfs_rq, pos) {
13940 touch_nmi_watchdog();
13941 touch_all_softlockup_watchdogs();
13942 print_cfs_rq(m, cpu, cfs_rq);
13943 }
13944 rcu_read_unlock();
13945 }
13946
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks
2025-11-17 4:57 [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks cx19970
2025-11-17 7:40 ` kernel test robot
@ 2025-11-17 8:02 ` kernel test robot
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-11-17 8:02 UTC (permalink / raw)
To: cx19970, mingo, peterz, juri.lelli, vincent.guittot
Cc: llvm, oe-kbuild-all, dietmar.eggemann, rostedt, bsegall, mgorman,
vschneid, linux-kernel, cx19970
Hi cx19970,
kernel test robot noticed the following build errors:
[auto build test ERROR on tip/sched/core]
[also build test ERROR on linus/master v6.18-rc6 next-20251114]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/cx19970/BUG-sysrq-Reset-the-watchdog-during-the-polling-of-sysrq-t-processing-tasks/20251117-130012
base: tip/sched/core
patch link: https://lore.kernel.org/r/tencent_B7DDA306E3B6A8CDF3195E4C083C9BD37E07%40qq.com
patch subject: [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks
config: arm-allnoconfig (https://download.01.org/0day-ci/archive/20251117/202511171548.yY6PHme5-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 0bba1e76581bad04e7d7f09f5115ae5e2989e0d9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251117/202511171548.yY6PHme5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511171548.yY6PHme5-lkp@intel.com/
All errors (new ones prefixed by >>):
>> kernel/sched/fair.c:13940:3: error: call to undeclared function 'touch_nmi_watchdog'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
13940 | touch_nmi_watchdog();
| ^
>> kernel/sched/fair.c:13941:3: error: call to undeclared function 'touch_all_softlockup_watchdogs'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
13941 | touch_all_softlockup_watchdogs();
| ^
2 errors generated.
--
In file included from kernel/sched/build_policy.c:52:
>> kernel/sched/rt.c:2941:3: error: call to undeclared function 'touch_nmi_watchdog'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2941 | touch_nmi_watchdog();
| ^
>> kernel/sched/rt.c:2942:3: error: call to undeclared function 'touch_all_softlockup_watchdogs'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
2942 | touch_all_softlockup_watchdogs();
| ^
2 errors generated.
vim +/touch_nmi_watchdog +13940 kernel/sched/fair.c
13933
13934 void print_cfs_stats(struct seq_file *m, int cpu)
13935 {
13936 struct cfs_rq *cfs_rq, *pos;
13937
13938 rcu_read_lock();
13939 for_each_leaf_cfs_rq_safe(cpu_rq(cpu), cfs_rq, pos) {
13940 touch_nmi_watchdog();
13941 touch_all_softlockup_watchdogs();
13942 print_cfs_rq(m, cpu, cfs_rq);
13943 }
13944 rcu_read_unlock();
13945 }
13946
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-17 8:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-17 4:57 [PATCH] BUG: sysrq: Reset the watchdog during the polling of sysrq-t processing tasks cx19970
2025-11-17 7:40 ` kernel test robot
2025-11-17 8:02 ` kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®