six locks: Improved optimistic spinning
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 5 Feb 2023 19:09:30 +0000 (14:09 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:50 +0000 (17:09 -0400)
commit91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f
treef2b5a01370f89f0a81df482e07bef2b4b5e37e0a
parent94c69fafa7081d84be89ba1067558be39b4ea44b
six locks: Improved optimistic spinning

This adds a threshold for the maximum spin time, similar to the rwsem
code, and a flag to the lock itself indicating when we've spun too long
so other threads also refrain from spinning.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/six.c
fs/bcachefs/six.h