aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/smr.h
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2020-02-04 02:44:52 +0000
committerJeff Roberson <jeff@FreeBSD.org>2020-02-04 02:44:52 +0000
commitbc6509845d454643cd65f0d640ed4412ecfcee2a (patch)
tree1f59f46d8ad9b8f38bb6936349dcec8496a383cb /sys/sys/smr.h
parentc8ea36e881bbd56cfd2aadb8fd1f4da0dfcd19ed (diff)
downloadsrc-bc6509845d454643cd65f0d640ed4412ecfcee2a.tar.gz
src-bc6509845d454643cd65f0d640ed4412ecfcee2a.zip
Implement a deferred write advancement feature that can be used to further
amortize shared cacheline writes. Discussed with: rlibby Differential Revision: https://reviews.freebsd.org/D23462
Notes
Notes: svn path=/head/; revision=357487
Diffstat (limited to 'sys/sys/smr.h')
-rw-r--r--sys/sys/smr.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/sys/smr.h b/sys/sys/smr.h
index b2c2fad07fec..0bd3d5ac77b5 100644
--- a/sys/sys/smr.h
+++ b/sys/sys/smr.h
@@ -64,6 +64,7 @@ typedef struct smr_shared *smr_shared_t;
struct smr {
smr_seq_t c_seq; /* Current observed sequence. */
smr_shared_t c_shared; /* Shared SMR state. */
+ int c_deferred; /* Deferred advance counter. */
};
/*
@@ -146,6 +147,13 @@ smr_exit(smr_t smr)
smr_seq_t smr_advance(smr_t smr);
/*
+ * Advances the write sequence number only after N calls. Returns
+ * the correct goal for a wr_seq that has not yet occurred. Used to
+ * minimize shared cacheline invalidations for frequent writers.
+ */
+smr_seq_t smr_advance_deferred(smr_t smr, int limit);
+
+/*
* Returns true if a goal sequence has been reached. If
* wait is true this will busy loop until success.
*/