netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] fix softlockup in run_timer_softirq
@ 2023-05-05 11:33 Liu Jian
  2023-05-05 11:33 ` [PATCH 1/9] softirq: Rewrite softirq processing loop Liu Jian
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Liu Jian @ 2023-05-05 11:33 UTC (permalink / raw)
  To: corbet, paulmck, frederic, quic_neeraju, joel, josh, boqun.feng,
	rostedt, mathieu.desnoyers, jiangshanlai, qiang1.zhang, jstultz,
	tglx, sboyd, davem, edumazet, kuba, pabeni, peterz, frankwoo,
	Rhinewuwu
  Cc: liujian56, linux-doc, linux-kernel, rcu, netdev

I encountered the run_timer_softirq lockup issue[1] many times during fuzz
tests. We analyze __run_timers() and find the following problem.

In the while loop of __run_timers(), because there are too many timers or
improper timer handler functions, if the processing time of the expired
timers is always greater than the time wheel's next_expiry, the function
will loop infinitely.

Here base on Peter's softirq_needs_break patchset[2], use the timeout/break
logic jump out of the loop.

[1] https://lore.kernel.org/lkml/fb8d80434b2148e78c0032c6c70a8b4d@huawei.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/log/?h=core/softirq

Liu Jian (1):
  softirq, timer: Use softirq_needs_break()

Peter Zijlstra (8):
  softirq: Rewrite softirq processing loop
  softirq: Use sched_clock() based timeout
  softirq: Factor loop termination condition
  softirq: Allow early break
  softirq: Context aware timeout
  softirq: Provide a softirq_needs_break() API
  softirq,net: Use softirq_needs_break()
  softirq,rcu: Use softirq_needs_break()

 Documentation/admin-guide/sysctl/net.rst | 11 +--
 include/linux/interrupt.h                |  5 ++
 kernel/rcu/tree.c                        | 29 ++-----
 kernel/rcu/tree_nocb.h                   |  2 +-
 kernel/softirq.c                         | 97 +++++++++++++++---------
 kernel/time/timer.c                      | 12 ++-
 net/core/dev.c                           |  6 +-
 net/core/dev.h                           |  1 -
 net/core/sysctl_net_core.c               |  8 --
 9 files changed, 86 insertions(+), 85 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-05-08 17:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-05 11:33 [PATCH 0/9] fix softlockup in run_timer_softirq Liu Jian
2023-05-05 11:33 ` [PATCH 1/9] softirq: Rewrite softirq processing loop Liu Jian
2023-05-05 11:33 ` [PATCH 2/9] softirq: Use sched_clock() based timeout Liu Jian
2023-05-08  4:08   ` Jason Xing
2023-05-08 17:51     ` Thomas Gleixner
2023-05-05 11:33 ` [PATCH 3/9] softirq: Factor loop termination condition Liu Jian
2023-05-05 11:33 ` [PATCH 4/9] softirq: Allow early break Liu Jian
2023-05-05 12:10   ` Eric Dumazet
2023-05-08  3:37     ` liujian (CE)
2023-05-05 11:33 ` [PATCH 5/9] softirq: Context aware timeout Liu Jian
2023-05-05 11:33 ` [PATCH 6/9] softirq: Provide a softirq_needs_break() API Liu Jian
2023-05-05 11:33 ` [PATCH 7/9] softirq,net: Use softirq_needs_break() Liu Jian
2023-05-08  6:21   ` Jason Xing
2023-05-05 11:33 ` [PATCH 8/9] softirq,rcu: " Liu Jian
2023-05-05 11:33 ` [PATCH 9/9] softirq, timer: " Liu Jian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).