36 lines
1.3 KiB
Diff
36 lines
1.3 KiB
Diff
From a6fd9edd1abb27cccce4016ec60cc643c8dba760 Mon Sep 17 00:00:00 2001
|
|
From: Nicholas Mc Guire <der.herr@hofr.at>
|
|
Date: Sun, 1 Dec 2013 23:03:52 -0500
|
|
Subject: [PATCH] seqlock: consolidate spin_lock/unlock waiting with
|
|
spin_unlock_wait
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/3.12/patches-3.12.6-rt9.tar.xz
|
|
|
|
since c2f21ce ("locking: Implement new raw_spinlock")
|
|
include/linux/spinlock.h includes spin_unlock_wait() to wait for a concurren
|
|
holder of a lock. this patch just moves over to that API. spin_unlock_wait
|
|
covers both raw_spinlock_t and spinlock_t so it should be safe here as well.
|
|
the added rt-variant of read_seqbegin in include/linux/seqlock.h that is being
|
|
modified, was introduced by patch:
|
|
seqlock-prevent-rt-starvation.patch
|
|
|
|
behavior should be unchanged.
|
|
|
|
Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
---
|
|
include/linux/seqlock.h | 3 +--
|
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
|
|
--- a/include/linux/seqlock.h
|
|
+++ b/include/linux/seqlock.h
|
|
@@ -236,8 +236,7 @@ static inline unsigned read_seqbegin(seq
|
|
* Take the lock and let the writer proceed (i.e. evtl
|
|
* boost it), otherwise we could loop here forever.
|
|
*/
|
|
- spin_lock(&sl->lock);
|
|
- spin_unlock(&sl->lock);
|
|
+ spin_unlock_wait(&sl->lock);
|
|
goto repeat;
|
|
}
|
|
return ret;
|