aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include
diff options
context:
space:
mode:
authorAndrew Gallatin <gallatin@FreeBSD.org>2022-12-14 19:34:07 +0000
committerAndrew Gallatin <gallatin@FreeBSD.org>2022-12-14 19:34:07 +0000
commit1cac76c93fb7f627fd9e304cbd99e8c8a2b8fce8 (patch)
tree478ab936c759d5b0ac77c1c066319635d63eeb70 /sys/amd64/include
parentc4a4b2633d975bd0813afca6b8e23ead29d80e82 (diff)
downloadsrc-1cac76c93fb7f627fd9e304cbd99e8c8a2b8fce8.tar.gz
src-1cac76c93fb7f627fd9e304cbd99e8c8a2b8fce8.zip
vm: reduce lock contention when processing vm batchqueues
Rather than waiting until the batchqueue is full to acquire the lock & process the queue, we now start trying to acquire the lock using trylocks when the batchqueue is 1/2 full. This removes almost all contention on the vm pagequeue mutex for for our busy sendfile() based web workload. It also greadly reduces the amount of time a network driver ithread remains blocked on a mutex, and eliminates some packet drops under heavy load. So that the system does not loose the benefit of processing large batchqueues, I've doubled the size of the batchqueues. This way, when there is no contention, we process the same batch size as before. This has been run for several months on a busy Netflix server, as well as on my personal desktop. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37305
Diffstat (limited to 'sys/amd64/include')
-rw-r--r--sys/amd64/include/vmparam.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/include/vmparam.h b/sys/amd64/include/vmparam.h
index fc88296f754c..205848489644 100644
--- a/sys/amd64/include/vmparam.h
+++ b/sys/amd64/include/vmparam.h
@@ -293,7 +293,7 @@
* Use a fairly large batch size since we expect amd64 systems to have lots of
* memory.
*/
-#define VM_BATCHQUEUE_SIZE 31
+#define VM_BATCHQUEUE_SIZE 63
/*
* The pmap can create non-transparent large page mappings.