Message ID | 20130606205514.GC5045@htj.dyndns.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On 06/06/2013 01:55 PM, Tejun Heo wrote: > Hello, Ben. > > On Wed, Jun 05, 2013 at 08:41:01PM -0700, Ben Greear wrote: >> On 06/05/2013 08:26 PM, Eric Dumazet wrote: >>> On Wed, 2013-06-05 at 20:14 -0700, Tejun Heo wrote: >>>> Ah, so, that's why it's showing up now. We probably have had the same >>>> issue all along but it used to be masked by the softirq limiting. Do >>>> you care to revive the 10 iterations limit so that it's limited by >>>> both the count and timing? We do wanna find out why softirq is >>>> spinning indefinitely tho. >>> >>> Yes, no problem, I can do that. >> >> Limiting it to 5000 fixes my problem, so if you wanted it larger than 10, that would >> be fine by me. > > First of all, kudos for tracking the issue down. While the removal of > looping limit in softirq handling was the direct cause for making the > problem visible, it's very bothering that we have softirq runaway. > Finding out the perpetrator shouldn't be hard. Something like the > following should work (untested). Once we know which softirq (prolly > the network one), we can dig deeper. The patch below assumes my fix is not in the code, right? I'll work on this, but it will probably be next week before I have time...gotta catch up on some other things first. Thanks, Ben
On Thu, Jun 06, 2013 at 02:15:40PM -0700, Ben Greear wrote: > >First of all, kudos for tracking the issue down. While the removal of > >looping limit in softirq handling was the direct cause for making the > >problem visible, it's very bothering that we have softirq runaway. > >Finding out the perpetrator shouldn't be hard. Something like the > >following should work (untested). Once we know which softirq (prolly > >the network one), we can dig deeper. > > The patch below assumes my fix is not in the code, right? Yeap. > I'll work on this, but it will probably be next week before > I have time...gotta catch up on some other things first. Thanks a lot for hunting this down!
diff --git a/kernel/softirq.c b/kernel/softirq.c index b5197dc..5af3682 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -212,6 +212,7 @@ asmlinkage void __do_softirq(void) unsigned long end = jiffies + MAX_SOFTIRQ_TIME; int cpu; unsigned long old_flags = current->flags; + int cnt = 0; /* * Mask out PF_MEMALLOC s current task context is borrowed for the @@ -244,6 +245,9 @@ restart: kstat_incr_softirqs_this_cpu(vec_nr); trace_softirq_entry(vec_nr); + if (++cnt >= 5000 && cnt < 5010) + printk("XXX __do_softirq: stuck handling softirqs, cnt=%d action=%pf\n", + cnt, h->action); h->action(h); trace_softirq_exit(vec_nr); if (unlikely(prev_count != preempt_count())) {