diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-05 14:09:30 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:50 -0400 |
commit | 91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f (patch) | |
tree | f2b5a01370f89f0a81df482e07bef2b4b5e37e0a /fs/bcachefs/six.h | |
parent | 94c69fafa7081d84be89ba1067558be39b4ea44b (diff) | |
download | linux-91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f.tar.gz linux-91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f.tar.bz2 linux-91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f.zip |
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>
Diffstat (limited to 'fs/bcachefs/six.h')
-rw-r--r-- | fs/bcachefs/six.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/six.h b/fs/bcachefs/six.h index c9159cd51d20..09abea29a021 100644 --- a/fs/bcachefs/six.h +++ b/fs/bcachefs/six.h @@ -83,9 +83,10 @@ union six_lock_state { }; struct { - unsigned read_lock:27; + unsigned read_lock:26; unsigned write_locking:1; unsigned intent_lock:1; + unsigned nospin:1; unsigned waiters:3; /* * seq works much like in seqlocks: it's incremented every time |