]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/vm/vm_page.h
Add support for multithreading the inactive queue pageout within a domain.
authorConrad Meyer <cem@FreeBSD.org>
Tue, 11 Aug 2020 20:37:45 +0000 (20:37 +0000)
committerConrad Meyer <cem@FreeBSD.org>
Tue, 11 Aug 2020 20:37:45 +0000 (20:37 +0000)
commit0292c54bdb080ea25c56db45b6c5557769e55ad8
tree6d34069dd94e6e242bf2b3f386e29b385b41ce29
parent91b31c100b5eb30c59f2f78dd10922e7e0b2c6e2
Add support for multithreading the inactive queue pageout within a domain.

In very high throughput workloads, the inactive scan can become overwhelmed
as you have many cores producing pages and a single core freeing.  Since
Mark's introduction of batched pagequeue operations, we can now run multiple
inactive threads working on independent batches.

To avoid confusing the pid and other control algorithms, I (Jeff) do this in
a mpi-like fan out and collect model that is driven from the primary page
daemon.  It decides whether the shortfall can be overcome with a single
thread and if not dispatches multiple threads and waits for their results.

The heuristic is based on timing the pageout activity and averaging a
pages-per-second variable which is exponentially decayed. This is visible in
sysctl and may be interesting for other purposes.

I (Jeff) have verified that this does indeed double our paging throughput
when used with two threads. With four we tend to run into other contention
problems.  For now I would like to commit this infrastructure with only a
single thread enabled.

The number of worker threads per domain can be controlled with the
'vm.pageout_threads_per_domain' tunable.

Submitted by: jeff (earlier version)
Discussed with: markj
Tested by: pho
Sponsored by: probably Netflix (based on contemporary commits)
Differential Revision: https://reviews.freebsd.org/D21629
sys/vm/vm_meter.c
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_pageout.c
sys/vm/vm_pagequeue.h