aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-03-01 16:16:02 +0100
committerSteven Rostedt <rostedt@rostedt.homelinux.com>2013-04-23 11:29:04 -0400
commitb3bbe12bc8f9ac75a45ac8cb536e8079f74aa262 (patch)
treef3d12f4fc4171e981f9d5766433bb5413f605b7a /include
parentc9d2c2e081e3c661585818292f1938aea8e7746e (diff)
net: u64_stat: Protect seqcount
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 Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/u64_stats_sync.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/u64_stats_sync.h b/include/linux/u64_stats_sync.h
index 8da8c4e87da3..b39549fb3c3f 100644
--- a/include/linux/u64_stats_sync.h
+++ b/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(struct u64_stats_sync *syncp)
{
#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
write_seqcount_end(&syncp->seq);
+ preempt_enable_rt();
#endif
}