mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-16 02:44:26 +08:00
rcu: Mark writes to the rcu_segcblist structure's ->flags field
[ Upstream commit c099290310
]
KCSAN reports data races between the rcu_segcblist_clear_flags() and
rcu_segcblist_set_flags() functions, though misreporting the latter
as a call to rcu_segcblist_is_enabled() from call_rcu(). This commit
converts the updates of this field to WRITE_ONCE(), relying on the
resulting unmarked reads to continue to detect buggy concurrent writes
to this field.
Reported-by: Zhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
99780fcb54
commit
e34806c6c2
@ -56,13 +56,13 @@ static inline long rcu_segcblist_n_cbs(struct rcu_segcblist *rsclp)
|
||||
static inline void rcu_segcblist_set_flags(struct rcu_segcblist *rsclp,
|
||||
int flags)
|
||||
{
|
||||
rsclp->flags |= flags;
|
||||
WRITE_ONCE(rsclp->flags, rsclp->flags | flags);
|
||||
}
|
||||
|
||||
static inline void rcu_segcblist_clear_flags(struct rcu_segcblist *rsclp,
|
||||
int flags)
|
||||
{
|
||||
rsclp->flags &= ~flags;
|
||||
WRITE_ONCE(rsclp->flags, rsclp->flags & ~flags);
|
||||
}
|
||||
|
||||
static inline bool rcu_segcblist_test_flags(struct rcu_segcblist *rsclp,
|
||||
|
Loading…
Reference in New Issue
Block a user