From c9c39057cb9f502cad638153d9ebeda243ce2b95 Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 2 Oct 2024 11:21:11 -0700 Subject: [PATCH] Use smp_cond_acquire to have the processor wait until the value changes. Signed-off-by: Christoph Lameter (Ampere) --- include/linux/seqlock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index fffeb754880f..ae112a50605e 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h @@ -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) -- 2.47.3