35 lines
1.0 KiB
Diff
35 lines
1.0 KiB
Diff
Subject: net: u64_stat: Protect seqcount
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Thu, 01 Mar 2012 16:16:02 +0100
|
|
|
|
On RT we must prevent that the writer gets preempted inside the write
|
|
section. Otherwise a preempting reader might spin forever.
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
Cc: stable-rt@vger.kernel.org
|
|
|
|
---
|
|
include/linux/u64_stats_sync.h | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
Index: linux-3.2/include/linux/u64_stats_sync.h
|
|
===================================================================
|
|
--- linux-3.2.orig/include/linux/u64_stats_sync.h
|
|
+++ linux-3.2/include/linux/u64_stats_sync.h
|
|
@@ -70,6 +70,7 @@ struct u64_stats_sync {
|
|
static inline void u64_stats_update_begin(struct u64_stats_sync *syncp)
|
|
{
|
|
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
|
|
+ preempt_disable_rt();
|
|
write_seqcount_begin(&syncp->seq);
|
|
#endif
|
|
}
|
|
@@ -78,6 +79,7 @@ static inline void u64_stats_update_end(
|
|
{
|
|
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
|
|
write_seqcount_end(&syncp->seq);
|
|
+ preempt_enable_rt();
|
|
#endif
|
|
}
|
|
|