]> www.infradead.org Git - users/jedix/linux-maple.git/commit
locking/local_lock: add localtry_trylock()
authorVlastimil Babka <vbabka@suse.cz>
Thu, 13 Feb 2025 18:38:31 +0000 (19:38 +0100)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 4 Mar 2025 16:35:05 +0000 (11:35 -0500)
commit3edb8f17215d6c4793fbe02167901da6ac319b6d
tree18e92653ad24cdaa2e312e5ca9ebea9f9a285a78
parent0373ef0e52e966c25d7cf1500e4c94491cbc6b2e
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