]> www.infradead.org Git - users/jedix/linux-maple.git/commit
seqlock: add raw_seqcount_try_begin
authorSuren Baghdasaryan <surenb@google.com>
Fri, 22 Nov 2024 17:44:14 +0000 (09:44 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 2 Dec 2024 11:01:37 +0000 (12:01 +0100)
commit96450ead16527cbef559b5bd046182e731228f95
tree516ee8a88ccd3d66cfb81b6a13e5d40e6e7baeec
parentb4943b8bfc41ddd3796f3b87e1efa71a0c689f22
seqlock: add raw_seqcount_try_begin

Add raw_seqcount_try_begin() to opens a read critical section of the given
seqcount_t if the counter is even. This enables eliding the critical
section entirely if the counter is odd, instead of doing the speculation
knowing it will fail.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
Link: https://lkml.kernel.org/r/20241122174416.1367052-1-surenb@google.com
include/linux/seqlock.h