public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* too much timer simplification...
@ 2003-04-11  7:05 David Mosberger
  2003-04-11  7:28 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: David Mosberger @ 2003-04-11  7:05 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel

It appears to me that this changeset:

  http://linux.bkbits.net:8080/linux-2.5/diffs/kernel/timer.c@1.48

may have gone a little too far.

What I'm seeing is that if someone happens to arm a periodic timer at
exactly 256 jiffies (as ohci happens to do on platforms with HZ=1024),
then you end up getting an endless loop of timer activations, causing
a machine hang.

The problem is that __run_timers updates base->timer_jiffies _before_
running the callback routines.  If a callback re-arms the timer at
exactly 256 jiffies, add_timers() will reinsert the timer into the
list that we're currently processing, which of course will cause the
timer to expire immediately again, etc., etc., ad naseum...

I'll leave it as an exercise to the readers to come up with the proper
patch.  (The old code looked fine to me.  My cheesy quick workaround
is to round up 256 ticks to 257 ticks; might not make the soft RT
folks too happy though... ;-)

	--david

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

end of thread, other threads:[~2003-04-11 22:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-11  7:05 too much timer simplification David Mosberger
2003-04-11  7:28 ` Andrew Morton
2003-04-11 18:53   ` george anzinger
2003-04-11 22:47   ` george anzinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox