]> Gentwo Git Trees - linux/.git/commitdiff
Use smp_cond_acquire to have the processor wait until the b4/seq_cond_wait
authorChristoph Lameter <cl@gentwo.org>
Wed, 2 Oct 2024 18:21:11 +0000 (11:21 -0700)
committerChristoph Lameter <cl@gentwo.org>
Wed, 2 Oct 2024 18:21:11 +0000 (11:21 -0700)
value changes.

Signed-off-by: Christoph Lameter (Ampere) <cl@linux.com>
include/linux/seqlock.h

index fffeb754880fca84672e89cd8dfdaa973a6e7a47..ae112a50605ea04bf23c18e0079f17a22cae4d7c 100644 (file)
@@ -170,7 +170,7 @@ __seqprop_##lockname##_sequence(const seqcount_##lockname##_t *s)   \
                 * Re-read the sequence counter since the (possibly     \
                 * preempted) writer made progress.                     \
                 */                                                     \
-               seq = smp_load_acquire(&s->seqcount.sequence);          \
+               seq = smp_cond_load_acquire(&s->seqcount.sequence, ((VAL & 1) == 0));   \
        }                                                               \
                                                                        \
        return seq;                                                     \
@@ -208,7 +208,7 @@ static inline const seqcount_t *__seqprop_const_ptr(const seqcount_t *s)
 
 static inline unsigned __seqprop_sequence(const seqcount_t *s)
 {
-       return smp_load_acquire(&s->sequence);
+       return smp_cond_load_acquire(&s->sequence, ((VAL & 1) == 0));
 }
 
 static inline bool __seqprop_preemptible(const seqcount_t *s)