mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: tglx@linutronix.de
Cc: john stultz <johnstul@us.ibm.com>, Ingo Molnar <mingo@elte.hu>,
	Roman Zippel <zippel@linux-m68k.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [ANNOUNCE] 2.6.15-rc5-hrt2 - hrtimers based high resolution patches
Date: Tue, 13 Dec 2005 16:05:27 -0500	[thread overview]
Message-ID: <1134507927.18921.26.camel@localhost.localdomain> (raw)
In-Reply-To: <1134385343.4205.72.camel@tglx.tec.linutronix.de>

Thomas and Ingo,

I found a bug in 2.6.15-rc5-rt1 that was due to a race in the hrtimers
code.  This bug is most likely in the vanilla hrtimers code as well.

I added a HRTIMER_RUNNING state because there's a moment in the
run_hrtimer_queues that turns interrupts on and releases the base lock.
In this time, a remove_hrtimer can be called while the state is still
HRTIMER_PENDING_CALLBACK, but it has been removed off the list.  The
remove_hrtimer will then try to remove this again.

Since I couldn't think of which state to use, I created the
HRTIMER_RUNNING, and used that instead.

I have a program (a simple jitter test) that, with out the patch,
reliably crashes the 2.6.15-rc5-rt1 on a slow UP machine.  With the
patch, it runs solidly, so I know this is the reason for the crash.

-- Steve

Index: linux-2.6.15-rc5-rt1/kernel/hrtimer.c
===================================================================
--- linux-2.6.15-rc5-rt1.orig/kernel/hrtimer.c	2005-12-13 15:51:52.000000000 -0500
+++ linux-2.6.15-rc5-rt1/kernel/hrtimer.c	2005-12-13 15:53:36.000000000 -0500
@@ -846,6 +846,7 @@
 		data = timer->data;
 		set_curr_timer(base, timer);
 		list_del(&timer->list);
+		timer->state = HRTIMER_RUNNING;
 		spin_unlock_irq(&base->lock);
 
 		/*
@@ -904,6 +905,7 @@
 		data = timer->data;
 		set_curr_timer(base, timer);
 		__remove_hrtimer(timer, base);
+		timer->state = HRTIMER_RUNNING;
 		spin_unlock_irq(&base->lock);
 
 		/*
Index: linux-2.6.15-rc5-rt1/include/linux/hrtimer.h
===================================================================
--- linux-2.6.15-rc5-rt1.orig/include/linux/hrtimer.h	2005-12-13 15:51:40.000000000 -0500
+++ linux-2.6.15-rc5-rt1/include/linux/hrtimer.h	2005-12-13 15:55:21.000000000 -0500
@@ -41,6 +41,7 @@
 enum hrtimer_state {
 	HRTIMER_INACTIVE,		/* Timer is inactive */
 	HRTIMER_EXPIRED,		/* Timer is expired */
+	HRTIMER_RUNNING,		/* Timer is currently running */
 	HRTIMER_PENDING,		/* Timer is pending */
 	HRTIMER_PENDING_CALLBACK,	/* Timer is expired, callback pending */
 };



  parent reply	other threads:[~2005-12-13 21:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-12 11:02 Thomas Gleixner
2005-12-12 13:56 ` Steven Rostedt
2005-12-13 21:05 ` Steven Rostedt [this message]
2005-12-14  8:40   ` Ingo Molnar
2005-12-14  8:43     ` Ingo Molnar
2005-12-14 13:48       ` Steven Rostedt
2005-12-14 14:01         ` Thomas Gleixner
2005-12-14 14:01           ` Steven Rostedt
2005-12-14 15:43           ` [PATCH -RT] Add softirq waitqueue for CONFIG_PREEMPT_SOFTIRQ (was: Re: [ANNOUNCE] 2.6.15-rc5-hrt2 ...) Steven Rostedt
2005-12-14 16:17             ` Daniel Walker
2005-12-20 13:28             ` Ingo Molnar
2005-12-14 14:04         ` [ANNOUNCE] 2.6.15-rc5-hrt2 - hrtimers based high resolution patches Steven Rostedt
2005-12-14 19:28           ` Steven Rostedt
2006-01-10 23:59       ` Steven Rostedt
2006-01-12  2:14         ` Steven Rostedt
2006-01-12  2:51           ` [PATCH RT] fix or hrtimers (was: [ANNOUNCE] 2.6.15-rc5-hrt2 - hrtimers based high resolution patches) Steven Rostedt
2006-01-12 11:10             ` Steven Rostedt
2006-01-17 17:35         ` [ANNOUNCE] 2.6.15-rc5-hrt2 - hrtimers based high resolution patches Thomas Gleixner
2005-12-14 18:33 ` Jeff Carr
2005-12-15  0:41 ` Jeff Carr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1134507927.18921.26.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome