All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RT 0/3] 4.4.131-rt148-rc1
@ 2018-05-04 13:55 Daniel Wagner
  2018-05-04 13:55 ` [PATCH RT 1/3] alarmtimer: Prevent live lock in alarm_cancel() Daniel Wagner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Wagner @ 2018-05-04 13:55 UTC (permalink / raw)
  To: linux-rt-users
  Cc: linux-kernel, Steven Rostedt, Thomas Gleixner, Carsten Emde,
	John Kacur, Sebastian Andrzej Siewior, Daniel Wagner,
	Tom Zanussi, Julia Cartwright, Daniel Wagner

Dear RT Folks,

This is the RT stable review cycle of patch 4.4.131-rt148-rc1.

Here are couple of patches from Sebiastian which didn't make into
4.4.126-rt142 cycle.  I haven't included Julia's "seqlock: provide the
same ordering semantics as mainline" patch, because I don't know it
needs a review or not.

The pre-releases will not be pushed to the git repository, only the
final release is.

If all goes well, this patch will be converted to the next main release
on 09.05.2017.

Enjoy,
-- Daniel


Daniel Wagner (1):
  Linux 4.4.131-rt148-rc1

Sebastian Andrzej Siewior (2):
  alarmtimer: Prevent live lock in alarm_cancel()
  posix-timers: move the rcu head out of the union

 include/linux/posix-timers.h | 2 +-
 kernel/time/alarmtimer.c     | 2 +-
 kernel/time/posix-timers.c   | 4 ++--
 localversion-rt              | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

-- 
2.14.3

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

* [PATCH RT 1/3] alarmtimer: Prevent live lock in alarm_cancel()
  2018-05-04 13:55 [PATCH RT 0/3] 4.4.131-rt148-rc1 Daniel Wagner
@ 2018-05-04 13:55 ` Daniel Wagner
  2018-05-04 13:55 ` [PATCH RT 2/3] posix-timers: move the rcu head out of the union Daniel Wagner
  2018-05-04 13:55 ` [PATCH RT 3/3] Linux 4.4.131-rt148-rc1 Daniel Wagner
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2018-05-04 13:55 UTC (permalink / raw)
  To: linux-rt-users
  Cc: linux-kernel, Steven Rostedt, Thomas Gleixner, Carsten Emde,
	John Kacur, Sebastian Andrzej Siewior, Daniel Wagner,
	Tom Zanussi, Julia Cartwright, stable-rt

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

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

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/time/alarmtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 6fcc367ad531..9d5eac2c9275 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -392,7 +392,7 @@ int alarm_cancel(struct alarm *alarm)
 		int ret = alarm_try_to_cancel(alarm);
 		if (ret >= 0)
 			return ret;
-		cpu_relax();
+		hrtimer_wait_for_timer(&alarm->timer);
 	}
 }
 EXPORT_SYMBOL_GPL(alarm_cancel);
-- 
2.14.3

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

* [PATCH RT 2/3] posix-timers: move the rcu head out of the union
  2018-05-04 13:55 [PATCH RT 0/3] 4.4.131-rt148-rc1 Daniel Wagner
  2018-05-04 13:55 ` [PATCH RT 1/3] alarmtimer: Prevent live lock in alarm_cancel() Daniel Wagner
@ 2018-05-04 13:55 ` Daniel Wagner
  2018-05-04 13:55 ` [PATCH RT 3/3] Linux 4.4.131-rt148-rc1 Daniel Wagner
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2018-05-04 13:55 UTC (permalink / raw)
  To: linux-rt-users
  Cc: linux-kernel, Steven Rostedt, Thomas Gleixner, Carsten Emde,
	John Kacur, Sebastian Andrzej Siewior, Daniel Wagner,
	Tom Zanussi, Julia Cartwright, stable-rt

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

On RT the timer can be preempted while running and therefore we wait
with timer_wait_for_callback() for the timer to complete (instead of
busy looping). The RCU-readlock is held to ensure that this posix timer
is not removed while we wait on it.
If the timer is removed then it invokes call_rcu() with a pointer that
is shared with the hrtimer because it is part of the same union.
In order to avoid any possible side effects I am moving the rcu pointer
out of the union.

Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 include/linux/posix-timers.h | 2 +-
 kernel/time/posix-timers.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 907f3fd191ac..e2e43c61f6a1 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -92,8 +92,8 @@ struct k_itimer {
 			struct alarm alarmtimer;
 			ktime_t interval;
 		} alarm;
-		struct rcu_head rcu;
 	} it;
+	struct rcu_head rcu;
 };
 
 struct k_clock {
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 48ca053dae2e..0808e2ae49bf 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -567,7 +567,7 @@ static struct k_itimer * alloc_posix_timer(void)
 
 static void k_itimer_rcu_free(struct rcu_head *head)
 {
-	struct k_itimer *tmr = container_of(head, struct k_itimer, it.rcu);
+	struct k_itimer *tmr = container_of(head, struct k_itimer, rcu);
 
 	kmem_cache_free(posix_timers_cache, tmr);
 }
@@ -584,7 +584,7 @@ static void release_posix_timer(struct k_itimer *tmr, int it_id_set)
 	}
 	put_pid(tmr->it_pid);
 	sigqueue_free(tmr->sigq);
-	call_rcu(&tmr->it.rcu, k_itimer_rcu_free);
+	call_rcu(&tmr->rcu, k_itimer_rcu_free);
 }
 
 static struct k_clock *clockid_to_kclock(const clockid_t id)
-- 
2.14.3

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

* [PATCH RT 3/3] Linux 4.4.131-rt148-rc1
  2018-05-04 13:55 [PATCH RT 0/3] 4.4.131-rt148-rc1 Daniel Wagner
  2018-05-04 13:55 ` [PATCH RT 1/3] alarmtimer: Prevent live lock in alarm_cancel() Daniel Wagner
  2018-05-04 13:55 ` [PATCH RT 2/3] posix-timers: move the rcu head out of the union Daniel Wagner
@ 2018-05-04 13:55 ` Daniel Wagner
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Wagner @ 2018-05-04 13:55 UTC (permalink / raw)
  To: linux-rt-users
  Cc: linux-kernel, Steven Rostedt, Thomas Gleixner, Carsten Emde,
	John Kacur, Sebastian Andrzej Siewior, Daniel Wagner,
	Tom Zanussi, Julia Cartwright, Daniel Wagner

Signed-off-by: Daniel Wagner <wagi@monom.org>
---
 localversion-rt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/localversion-rt b/localversion-rt
index d3fa072b6b43..823843af1026 100644
--- a/localversion-rt
+++ b/localversion-rt
@@ -1 +1 @@
--rt147
+-rt148-rc1
-- 
2.14.3

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

end of thread, other threads:[~2018-05-04 13:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-04 13:55 [PATCH RT 0/3] 4.4.131-rt148-rc1 Daniel Wagner
2018-05-04 13:55 ` [PATCH RT 1/3] alarmtimer: Prevent live lock in alarm_cancel() Daniel Wagner
2018-05-04 13:55 ` [PATCH RT 2/3] posix-timers: move the rcu head out of the union Daniel Wagner
2018-05-04 13:55 ` [PATCH RT 3/3] Linux 4.4.131-rt148-rc1 Daniel Wagner

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.