mirror of https://lore.kernel.org/lkml/
 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>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	John Kacur <jkacur@redhat.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Julia Cartwright <julia@ni.com>,
	Daniel Wagner <daniel.wagner@siemens.com>,
	tom.zanussi@linux.intel.com, Alex Shi <alex.shi@linaro.org>,
	stable-rt@vger.kernel.org, Alexander Gerasiov <gq@cs.msu.su>
Subject: [PATCH RT 1/8] timer/hrtimer: check properly for a running timer
Date: Tue, 21 Nov 2017 11:06:55 -0500	[thread overview]
Message-ID: <20171121160705.806323930@goodmis.org> (raw)
In-Reply-To: <20171121160654.493640386@goodmis.org>

[-- Attachment #1: 0001-timer-hrtimer-check-properly-for-a-running-timer.patch --]
[-- Type: text/plain, Size: 1344 bytes --]

4.4.97-rt111-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

hrtimer_callback_running() checks only whether a timmer is running on a
CPU in hardirq-context. This is okay for !RT. For RT environment we move
most timers to the timer-softirq and therefore we therefore need to
check if the timer is running in the softirq context.

Cc: stable-rt@vger.kernel.org
Reported-by: Alexander Gerasiov <gq@cs.msu.su>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/linux/hrtimer.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 8fbcdfa5dc77..ff317006d3e8 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -455,7 +455,13 @@ static inline int hrtimer_is_queued(struct hrtimer *timer)
  */
 static inline int hrtimer_callback_running(const struct hrtimer *timer)
 {
-	return timer->base->cpu_base->running == timer;
+	if (timer->base->cpu_base->running == timer)
+		return 1;
+#ifdef CONFIG_PREEMPT_RT_BASE
+	if (timer->base->cpu_base->running_soft == timer)
+		return 1;
+#endif
+	return 0;
 }
 
 /* Forward a hrtimer so it expires after now: */
-- 
2.13.2

  reply	other threads:[~2017-11-21 16:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 16:06 [PATCH RT 0/8] Linux 4.4.97-rt111-rc1 Steven Rostedt
2017-11-21 16:06 ` Steven Rostedt [this message]
2017-11-21 16:06 ` [PATCH RT 2/8] rtmutex: Make lock_killable work Steven Rostedt
2017-11-21 16:06 ` [PATCH RT 3/8] random: avoid preempt_disable()ed section Steven Rostedt
2017-11-21 16:06 ` [PATCH RT 4/8] sched: Prevent task state corruption by spurious lock wakeup Steven Rostedt
2017-11-21 16:06 ` [PATCH RT 5/8] sched: Remove TASK_ALL Steven Rostedt
2017-11-21 16:19   ` Peter Zijlstra
2017-11-21 16:27     ` Steven Rostedt
2017-11-21 17:26       ` Thomas Gleixner
2017-11-21 16:07 ` [PATCH RT 6/8] sched/migrate disable: handle updated task-mask mg-dis section Steven Rostedt
2017-11-21 16:07 ` [PATCH RT 8/8] Linux 4.4.97-rt111-rc1 Steven Rostedt
     [not found] ` <20171121160706.703915626@goodmis.org>
2017-11-21 16:20   ` [PATCH RT 7/8] kernel/locking: use an exclusive wait_q for sleepers 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=20171121160705.806323930@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=C.Emde@osadl.org \
    --cc=alex.shi@linaro.org \
    --cc=bigeasy@linutronix.de \
    --cc=daniel.wagner@siemens.com \
    --cc=gq@cs.msu.su \
    --cc=jkacur@redhat.com \
    --cc=julia@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=stable-rt@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    /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