summaryrefslogtreecommitdiff
path: root/fs/bcachefs/six.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-05 22:09:30 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:50 +0300
commit91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f (patch)
treef2b5a01370f89f0a81df482e07bef2b4b5e37e0a /fs/bcachefs/six.h
parent94c69fafa7081d84be89ba1067558be39b4ea44b (diff)
downloadlinux-91db80668149a4eb19ab3bfcfecf9f09ad1f2c8f.tar.xz
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.h3
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