Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108432824
D48377.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48377.diff
View Options
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -461,6 +461,7 @@
vmd->vmd_free_count = 0;
vmd->vmd_segs = 0;
vmd->vmd_oom = false;
+ vmd->vmd_helper_threads_enabled = true;
for (i = 0; i < PQ_COUNT; i++) {
pq = &vmd->vmd_pagequeues[i];
TAILQ_INIT(&pq->pq_pl);
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -1644,8 +1644,9 @@
* If we have more work than we can do in a quarter of our interval, we
* fire off multiple threads to process it.
*/
- threads = vmd->vmd_inactive_threads;
- if (threads > 1 && vmd->vmd_inactive_pps != 0 &&
+ if ((threads = vmd->vmd_inactive_threads) > 1 &&
+ vmd->vmd_helper_threads_enabled &&
+ vmd->vmd_inactive_pps != 0 &&
shortage > vmd->vmd_inactive_pps / VM_INACT_SCAN_RATE / 4) {
vmd->vmd_inactive_shortage /= threads;
slop = shortage % threads;
@@ -2269,6 +2270,10 @@
pidctrl_init_sysctl(&vmd->vmd_pid, SYSCTL_CHILDREN(oid));
vmd->vmd_inactive_threads = get_pageout_threads_per_domain(vmd);
+ SYSCTL_ADD_BOOL(NULL, SYSCTL_CHILDREN(vmd->vmd_oid), OID_AUTO,
+ "pageout_helper_threads_enabled", CTLFLAG_RWTUN,
+ &vmd->vmd_helper_threads_enabled, 0,
+ "Enable multi-threaded inactive queue scanning");
}
static void
diff --git a/sys/vm/vm_pagequeue.h b/sys/vm/vm_pagequeue.h
--- a/sys/vm/vm_pagequeue.h
+++ b/sys/vm/vm_pagequeue.h
@@ -257,8 +257,9 @@
/* Paging control variables, used within single threaded page daemon. */
struct pidctrl vmd_pid; /* Pageout controller. */
- bool vmd_oom;
- u_int vmd_inactive_threads;
+ bool vmd_oom; /* An OOM kill was requested. */
+ bool vmd_helper_threads_enabled;/* Use multiple threads to scan. */
+ u_int vmd_inactive_threads; /* Number of extra helper threads. */
u_int vmd_inactive_shortage; /* Per-thread shortage. */
blockcount_t vmd_inactive_running; /* Number of inactive threads. */
blockcount_t vmd_inactive_starting; /* Number of threads started. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 25, 5:44 PM (18 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16157197
Default Alt Text
D48377.diff (1 KB)
Attached To
Mode
D48377: vm_pageout: Add a chicken switch for multithreaded PQ_INACTIVE scanning
Attached
Detach File
Event Timeline
Log In to Comment