]> www.infradead.org Git - users/jedix/linux-maple.git/commit
slab: switch percpu sheaves locking to localtry_lock
authorVlastimil Babka <vbabka@suse.cz>
Wed, 28 Aug 2024 09:28:19 +0000 (11:28 +0200)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Tue, 4 Mar 2025 16:35:05 +0000 (11:35 -0500)
commitec8ebac28fc8177a0d43b172d44151843d169643
tree2fb8328b6cd0fc133b56788b01f644dc2b49d4e8
parent3edb8f17215d6c4793fbe02167901da6ac319b6d
slab: switch percpu sheaves locking to localtry_lock

Instead of local_lock_irqsave(), use localtry_trylock() when potential
callers include irq context, and localtry_lock() otherwise (such as when
we already know the gfp flags allow blocking).

This should reduce the locking (due to irq disabling/enabling) overhead.
Failing to use percpu sheaves in an irq due to preempting an already
locked user of sheaves should be rare so it's a favorable tradeoff.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c