Skip to contentSkip to conversation

4.4.131-rt148-rc1

PATCH New Daniel Wagner 1 participant 4 messages May 4, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 4.4.131-rt148-rc1

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(-)
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/3 alarmtimer: Prevent live lock in alarm_cancel()

From: Sebastian Andrzej Siewior <[email protected]>

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.

---
 kernel/time/alarmtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/time/alarmtimer.c +1 -1
index 6fcc367ad531..9d5eac2c9275 100644
@@ -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);
Signature · 1 line
2.14.3
#2 lore raw

PATCH 2/3 posix-timers: move the rcu head out of the union

In reply to Daniel Wagner

From: Sebastian Andrzej Siewior <[email protected]>

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.

---
 include/linux/posix-timers.h | 2 +-
 kernel/time/posix-timers.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/posix-timers.h +1 -1
index 907f3fd191ac..e2e43c61f6a1 100644
@@ -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 {
kernel/time/posix-timers.c +2 -2
index 48ca053dae2e..0808e2ae49bf 100644
@@ -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)
Signature · 1 line
2.14.3