Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115680607
D26152.id76075.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D26152.id76075.diff
View Options
Index: sys/vm/vm_pageout.c
===================================================================
--- sys/vm/vm_pageout.c
+++ sys/vm/vm_pageout.c
@@ -166,10 +166,11 @@
"Maximum active LRU update period");
/* Access with get_pageout_threads_per_domain(). */
-static int pageout_threads_per_domain = 1;
-SYSCTL_INT(_vm, OID_AUTO, pageout_threads_per_domain, CTLFLAG_RDTUN,
- &pageout_threads_per_domain, 0,
- "Number of worker threads comprising each per-domain pagedaemon");
+static int pageout_threads_per_domain;
+static int pageout_cpus_per_thread = 16;
+SYSCTL_INT(_vm, OID_AUTO, pageout_cpus_per_thread, CTLFLAG_RDTUN,
+ &pageout_cpus_per_thread, 0,
+ "Number of CPUs per pagedaemon worker thread");
SYSCTL_INT(_vm, OID_AUTO, lowmem_period, CTLFLAG_RWTUN, &lowmem_period, 0,
"Low memory callback period");
@@ -2203,33 +2204,29 @@
get_pageout_threads_per_domain(void)
{
static bool resolved = false;
- int half_cpus_per_dom;
+ int cpus_per_dom;
/*
* This is serialized externally by the sorted autoconfig portion of
* boot.
*/
- if (__predict_true(resolved))
+ if (resolved)
return (pageout_threads_per_domain);
+ cpus_per_dom = howmany(mp_ncpus, vm_ndomains);
+
/*
* Semi-arbitrarily constrain pagedaemon threads to less than half the
- * total number of threads in the system as an insane upper limit.
+ * total number of CPUs in the system as an upper limit.
*/
- half_cpus_per_dom = howmany(mp_ncpus / vm_ndomains, 2);
+ if (pageout_cpus_per_thread < 2)
+ pageout_cpus_per_thread = 2;
+ else if (pageout_cpus_per_thread > cpus_per_dom)
+ pageout_cpus_per_thread = cpus_per_dom;
+
+ pageout_threads_per_domain = howmany(cpus_per_dom,
+ pageout_cpus_per_thread);
- if (pageout_threads_per_domain < 1) {
- printf("Invalid tuneable vm.pageout_threads_per_domain value: "
- "%d out of valid range: [1-%d]; clamping to 1\n",
- pageout_threads_per_domain, half_cpus_per_dom);
- pageout_threads_per_domain = 1;
- } else if (pageout_threads_per_domain > half_cpus_per_dom) {
- printf("Invalid tuneable vm.pageout_threads_per_domain value: "
- "%d out of valid range: [1-%d]; clamping to %d\n",
- pageout_threads_per_domain, half_cpus_per_dom,
- half_cpus_per_dom);
- pageout_threads_per_domain = half_cpus_per_dom;
- }
resolved = true;
return (pageout_threads_per_domain);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 28, 1:19 AM (11 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17824001
Default Alt Text
D26152.id76075.diff (2 KB)
Attached To
Mode
D26152: vm_pageout: Scale worker threads with CPUs
Attached
Detach File
Event Timeline
Log In to Comment