aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/buf.h
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2018-02-20 00:06:07 +0000
committerJeff Roberson <jeff@FreeBSD.org>2018-02-20 00:06:07 +0000
commit06220fa737d9e3bf45f1a9b716425fcacb5c4d64 (patch)
tree938bdd0941d47e048a087ed6be7f8e735dd83661 /sys/sys/buf.h
parent4b6da14cfa1ee9b815f80ca8077839f65bb6b3be (diff)
downloadsrc-06220fa737d9e3bf45f1a9b716425fcacb5c4d64.tar.gz
src-06220fa737d9e3bf45f1a9b716425fcacb5c4d64.zip
Further parallelize the buffer cache.
Provide multiple clean queues partitioned into 'domains'. Each domain manages its own bufspace and has its own bufspace daemon. Each domain has a set of subqueues indexed by the current cpuid to reduce lock contention on the cleanq. Refine the sleep/wakeup around the bufspace daemon to use atomics as much as possible. Add a B_REUSE flag that is used to requeue bufs during the scan to approximate LRU rather than locking the queue on every use of a frequently accessed buf. Implement bufspace_reserve with only atomic_fetchadd to avoid loop restarts. Reviewed by: markj Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14274
Notes
Notes: svn path=/head/; revision=329612
Diffstat (limited to 'sys/sys/buf.h')
-rw-r--r--sys/sys/buf.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/sys/buf.h b/sys/sys/buf.h
index 0875cde64b16..c9b2eeaed5b2 100644
--- a/sys/sys/buf.h
+++ b/sys/sys/buf.h
@@ -112,7 +112,9 @@ struct buf {
off_t b_offset; /* Offset into file. */
TAILQ_ENTRY(buf) b_bobufs; /* (V) Buffer's associated vnode. */
uint32_t b_vflags; /* (V) BV_* flags */
- unsigned short b_qindex; /* (Q) buffer queue index */
+ uint8_t b_qindex; /* (Q) buffer queue index */
+ uint8_t b_domain; /* (Q) buf domain this resides in */
+ uint16_t b_subqueue; /* (Q) per-cpu q if any */
uint32_t b_flags; /* B_* flags. */
b_xflags_t b_xflags; /* extra flags */
struct lock b_lock; /* Buffer lock */
@@ -217,7 +219,7 @@ struct buf {
#define B_DONE 0x00000200 /* I/O completed. */
#define B_EINTR 0x00000400 /* I/O was interrupted */
#define B_NOREUSE 0x00000800 /* Contents not reused once released. */
-#define B_00001000 0x00001000 /* Available flag. */
+#define B_REUSE 0x00001000 /* Contents reused, second chance. */
#define B_INVAL 0x00002000 /* Does not contain valid info. */
#define B_BARRIER 0x00004000 /* Write this and all preceding first. */
#define B_NOCACHE 0x00008000 /* Do not cache block after use. */
@@ -241,7 +243,7 @@ struct buf {
#define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \
"\33paging\32infreecnt\31nocopy\30b23\27relbuf\26b21\25b20" \
"\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \
- "\15b12\14noreuse\13eintr\12done\11b8\10delwri" \
+ "\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \
"\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age"
/*