[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200828083022.GO1362448@hirez.programming.kicks-ass.net>
Date: Fri, 28 Aug 2020 10:30:22 +0200
From: peterz@...radead.org
To: "Ahmed S. Darwish" <a.darwish@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Sebastian A. Siewior" <bigeasy@...utronix.de>,
"Paul E. McKenney" <paulmck@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 3/5] seqlock: seqcount_t: Implement all read APIs as
statement expressions
On Fri, Aug 28, 2020 at 03:07:08AM +0200, Ahmed S. Darwish wrote:
> #define __read_seqcount_begin(s) \
> +({ \
> + unsigned seq; \
> + \
> + do { \
> + seq = __seqcount_sequence(s); \
> + if (likely(! (seq & 1))) \
> + break; \
> + cpu_relax(); \
> + } while (true); \
> + \
> + kcsan_atomic_next(KCSAN_SEQLOCK_REGION_MAX); \
> + seq; \
> +})
Since we're there anyway, does it make sense to (re)write this like:
while ((seq = __seqcount_sequence(s)) & 1)
cpu_relax();
?
Powered by blists - more mailing lists