All of lore.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>,
	stable-rt@vger.kernel.org
Subject: [PATCH RT 3/7] rt: Introduce cpu_chill()
Date: Tue, 13 Mar 2012 22:27:01 -0400	[thread overview]
Message-ID: <20120314022945.018782675@goodmis.org> (raw)
In-Reply-To: 20120314022658.783312660@goodmis.org

[-- Attachment #1: 0003-rt-Introduce-cpu_chill.patch --]
[-- Type: text/plain, Size: 934 bytes --]

From: Thomas Gleixner <tglx@linutronix.de>

Retry loops on RT might loop forever when the modifying side was
preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill()
defaults to cpu_relax() for non RT. On RT it puts the looping task to
sleep for a tick so the preempted task can make progress.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/linux/delay.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/delay.h b/include/linux/delay.h
index a6ecb34..e23a7c0 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -52,4 +52,10 @@ static inline void ssleep(unsigned int seconds)
 	msleep(seconds * 1000);
 }
 
+#ifdef CONFIG_PREEMPT_RT_FULL
+# define cpu_chill()	msleep(1)
+#else
+# define cpu_chill()	cpu_relax()
+#endif
+
 #endif /* defined(_LINUX_DELAY_H) */
-- 
1.7.8.3

  parent reply	other threads:[~2012-03-14  2:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14  2:26 [PATCH RT 0/7] [ANNOUNCE] 3.0.23-rt40-rc1 Steven Rostedt
2012-03-14  2:26 ` [PATCH RT 1/7] Revert "ACPI: Convert embedded controller lock to raw spinlock" Steven Rostedt
2012-03-14  2:27 ` [PATCH RT 2/7] softirq: Check preemption after reenabling interrupts Steven Rostedt
2012-03-14  2:27 ` Steven Rostedt [this message]
2012-03-14  2:27 ` [PATCH RT 4/7] fs: dcache: Use cpu_chill() in trylock loops Steven Rostedt
2012-03-14  2:27 ` [PATCH RT 5/7] fs: namespace: Use cpu_chill() instead of cpu_relax() Steven Rostedt
2012-03-14  2:27 ` [PATCH RT 6/7] net: " Steven Rostedt
2012-03-14  2:27 ` [PATCH RT 7/7] Linux 3.0.23-rt40-rc1 Steven Rostedt
2012-03-14 12:52 ` [PATCH RT 0/7] [ANNOUNCE] 3.0.23-rt40-rc1 Karsten Wiese
2012-03-14 12:52   ` Karsten Wiese
2012-03-14 15:14   ` Steven Rostedt
2012-03-14 15:14     ` 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=20120314022945.018782675@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.