mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
srcu: Add data_race() to ->srcu_lock_count and ->srcu_unlock_count arrays
The srcu_data structure's ->srcu_lock_count and ->srcu_unlock_count arrays are read and written locklessly, so this commit adds the data_race() to the diagnostic-print loads from these arrays in order mark them as known and approved data-racy accesses. This data race was reported by KCSAN. Not appropriate for backporting due to failure being unlikely and due to this being used only by rcutorture. Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
This commit is contained in:
parent
065a6db12a
commit
b68c614651
1 changed files with 4 additions and 4 deletions
|
@ -1281,8 +1281,8 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
|
||||||
struct srcu_data *sdp;
|
struct srcu_data *sdp;
|
||||||
|
|
||||||
sdp = per_cpu_ptr(ssp->sda, cpu);
|
sdp = per_cpu_ptr(ssp->sda, cpu);
|
||||||
u0 = sdp->srcu_unlock_count[!idx];
|
u0 = data_race(sdp->srcu_unlock_count[!idx]);
|
||||||
u1 = sdp->srcu_unlock_count[idx];
|
u1 = data_race(sdp->srcu_unlock_count[idx]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make sure that a lock is always counted if the corresponding
|
* Make sure that a lock is always counted if the corresponding
|
||||||
|
@ -1290,8 +1290,8 @@ void srcu_torture_stats_print(struct srcu_struct *ssp, char *tt, char *tf)
|
||||||
*/
|
*/
|
||||||
smp_rmb();
|
smp_rmb();
|
||||||
|
|
||||||
l0 = sdp->srcu_lock_count[!idx];
|
l0 = data_race(sdp->srcu_lock_count[!idx]);
|
||||||
l1 = sdp->srcu_lock_count[idx];
|
l1 = data_race(sdp->srcu_lock_count[idx]);
|
||||||
|
|
||||||
c0 = l0 - u0;
|
c0 = l0 - u0;
|
||||||
c1 = l1 - u1;
|
c1 = l1 - u1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue