]> git.baikalelectronics.ru Git - kernel.git/commit
seqlock: Implement raw_seqcount_begin() in terms of raw_read_seqcount()
authorAhmed S. Darwish <a.darwish@linutronix.de>
Mon, 20 Jul 2020 15:55:12 +0000 (17:55 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 29 Jul 2020 14:14:24 +0000 (16:14 +0200)
commit857774d77bb8e6ac4fc7a08a665a240a4a2b6df5
treebef7aec2eec5bc5b2753ef09469faa88b32ddb52
parent23d34863d725c1e53d83928f4aa27d2522424e9d
seqlock: Implement raw_seqcount_begin() in terms of raw_read_seqcount()

raw_seqcount_begin() has the same code as raw_read_seqcount(), with the
exception of masking the sequence counter's LSB before returning it to
the caller.

Note, raw_seqcount_begin() masks the counter's LSB before returning it
to the caller so that read_seqcount_retry() can fail if the counter is
odd -- without the overhead of an extra branching instruction.

Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200720155530.1173732-7-a.darwish@linutronix.de
include/linux/seqlock.h