public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org,
	linux-rt-users <linux-rt-users@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>,
	Sankara Muthukrishnan <sankara.m@gmail.com>,
	stable-rt@vger.kernel.org
Subject: [PATCH RT 5/8] timer-fd: Prevent live lock
Date: Wed, 08 Feb 2012 20:59:31 -0500	[thread overview]
Message-ID: <20120209020159.978564482@goodmis.org> (raw)
In-Reply-To: 20120209015926.851312665@goodmis.org

[-- Attachment #1: 0005-timer-fd-Prevent-live-lock.patch --]
[-- Type: text/plain, Size: 893 bytes --]

From: Thomas Gleixner <tglx@linutronix.de>

If hrtimer_try_to_cancel() requires a retry, then depending on the
priority setting te retry loop might prevent timer callback completion
on RT. Prevent that by waiting for completion on RT, no change for a
non RT kernel.

Reported-by: Sankara Muthukrishnan <sankara.m@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/timerfd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/timerfd.c b/fs/timerfd.c
index dffeb37..57f0e4e 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -313,7 +313,7 @@ SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags,
 		if (hrtimer_try_to_cancel(&ctx->tmr) >= 0)
 			break;
 		spin_unlock_irq(&ctx->wqh.lock);
-		cpu_relax();
+		hrtimer_wait_for_timer(&ctx->tmr);
 	}
 
 	/*
-- 
1.7.8.3



  parent reply	other threads:[~2012-02-09  2:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09  1:59 [PATCH RT 0/8] [ANNOUNCE] 3.0.20-rt36-rc1 Steven Rostedt
2012-02-09  1:59 ` [PATCH RT 1/8] genirq: Unmask oneshot irqs when thread was not woken Steven Rostedt
2012-02-09  1:59 ` [PATCH RT 2/8] genirq: Handle pending irqs in irq_startup() Steven Rostedt
2012-02-09  1:59 ` [PATCH RT 3/8] signal/x86: Delay calling signals in atomic Steven Rostedt
2012-02-09  1:59 ` [PATCH RT 4/8] x86: Do not disable preemption in int3 on 32bit Steven Rostedt
2012-02-09  1:59 ` Steven Rostedt [this message]
2012-02-09  1:59 ` [PATCH RT 6/8] genirq: Allow disabling of softirq processing in irq thread context Steven Rostedt
2012-02-09  1:59 ` [PATCH RT 7/8] futex: Fix bug on when a requeued RT task times out Steven Rostedt
2012-02-09  1:59 ` [PATCH RT 8/8] Linux 3.0.20-rt36-rc1 Steven Rostedt

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=20120209020159.978564482@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=C.Emde@osadl.org \
    --cc=jkacur@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=sankara.m@gmail.com \
    --cc=stable-rt@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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