[<prev] [next>] [day] [month] [year] [list]
Message-ID: <158504140925.28353.13950952007552002585.tip-bot2@tip-bot2>
Date: Tue, 24 Mar 2020 09:16:49 -0000
From: "tip-bot2 for Paul E. McKenney" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Paul E. McKenney" <paulmck@...nel.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: core/rcu] rcu: Add WRITE_ONCE() to rcu_state ->gp_start
The following commit has been merged into the core/rcu branch of tip:
Commit-ID: 59881bcd85a06565c53fd13ce3b0ad7fa55e560c
Gitweb: https://git.kernel.org/tip/59881bcd85a06565c53fd13ce3b0ad7fa55e560c
Author: Paul E. McKenney <paulmck@...nel.org>
AuthorDate: Mon, 20 Jan 2020 15:29:04 -08:00
Committer: Paul E. McKenney <paulmck@...nel.org>
CommitterDate: Thu, 20 Feb 2020 15:58:23 -08:00
rcu: Add WRITE_ONCE() to rcu_state ->gp_start
The rcu_state structure's ->gp_start field is read locklessly, so this
commit adds the WRITE_ONCE() to an update in order to provide proper
documentation and READ_ONCE()/WRITE_ONCE() pairing.
This data race was reported by KCSAN. Not appropriate for backporting
due to failure being unlikely.
Signed-off-by: Paul E. McKenney <paulmck@...nel.org>
---
kernel/rcu/tree_stall.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/rcu/tree_stall.h b/kernel/rcu/tree_stall.h
index bca637b..488b71d 100644
--- a/kernel/rcu/tree_stall.h
+++ b/kernel/rcu/tree_stall.h
@@ -102,7 +102,7 @@ static void record_gp_stall_check_time(void)
unsigned long j = jiffies;
unsigned long j1;
- rcu_state.gp_start = j;
+ WRITE_ONCE(rcu_state.gp_start, j);
j1 = rcu_jiffies_till_stall_check();
/* Record ->gp_start before ->jiffies_stall. */
smp_store_release(&rcu_state.jiffies_stall, j + j1); /* ^^^ */
Powered by blists - more mailing lists