seqlock:do_raw_write_seqcount_end smp_wmb
hi, Peter:
I not quit sure on this, but is that a type error indo_raw_write_seqcount_end here ?
is this change necessary to match with do_raw_write_seqcount_begin ?
include/linux/seqlock.h +1 -1
@@ -486,8 +486,8 @@ do { \static inline void do_raw_write_seqcount_end (seqcount_t *s) { -smp_wmb (); s->sequence++; +smp_wmb ();kcsan_nestable_atomic_end (); }
to match with
static inline void do_raw_write_seqcount_begin(seqcount_t *s)
{
kcsan_nestable_atomic_begin();
s->sequence++;
smp_wmb();
}BR
TNT
Quoted 21 lines · Kassey Li
hi, Peter:
I not quit sure on this, but is that a type error indo_raw_write_seqcount_endhere ?
is this change necessary to match withdo_raw_write_seqcount_begin?include/linux/seqlock.h +1
-1@@ -486,8 +486,8 @@ do { \static inline void do_raw_write_seqcount_end (seqcount_t *s) { -smp_wmb (); s->sequence++; +smp_wmb ();kcsan_nestable_atomic_end (); }
Quoted 11 lines
to match with
static inline void
do_raw_write_seqcount_begin(seqcount_t *s){ kcsan_nestable_atomic_begin(); s->sequence++; smp_wmb(); }
I don't see anything wrong here. As per my understanding, do_raw_write_seqcount_end() marks the end of the writer side critical section. The data modified in the critical section should be visisble to the *reader* before seqcount::sequence increment is visible. The smp_wmb() here pairs with the smp_rmb() in the read_seqcount_begin(). Pls see kernel/sched/cputime.c for an example.
Thanks,
Pavan