]> www.infradead.org Git - users/jedix/linux-maple.git/commit
locking/local_lock: add localtry_trylock()
authorVlastimil Babka <vbabka@suse.cz>
Fri, 14 Feb 2025 16:27:40 +0000 (17:27 +0100)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 3 Mar 2025 18:43:51 +0000 (13:43 -0500)
commit7a63357c9b238ba5e7dab0dae64c37f6b5e03c2e
treedb7421cdeda0bb9448663847089f9635cf6d51c6
parent3ec84e0bb2a456e13312461d0523d2c250272fd9
locking/local_lock: add localtry_trylock()

Add a localtry_trylock() variant without _irqsave that will be used in
slab sheaves implementation. Thanks to only disabling preemption and not
irqs, it has a lower overhead. It's not necessary to disable irqs to
avoid a deadlock if the irq context uses trylock and can handle
failures.

Also make the comment of localtry_trylock() more clear, and fix a
compilation failure in localtry_lock_init().

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
include/linux/local_lock.h
include/linux/local_lock_internal.h