git: kernel - Refactor cpu localization for VM page allocations
dillon at crater.dragonflybsd.org
Fri Jul 29 17:17:48 PDT 2016
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Fri Jul 29 17:03:22 2016 -0700
kernel - Refactor cpu localization for VM page allocations
* Change how cpu localization works. The old scheme was extremely unbalanced
in terms of vm_page_queue load.
The new scheme uses cpu topology information to break the vm_page_queue
down into major blocks based on the physical package id, minor blocks
based on the core id in each physical package, and then by 1's based on
(pindex + object->pg_color).
If PQ_L2_SIZE is not big enough such that 16-way operation is attainable
by physical and core id, we break the queue down only by physical id.
Note that the core id is a real core count, not a cpu thread count, so
an 8-core/16-thread x 2 socket xeon system will just fit in the 16-way
requirement (there are 256 PQ_FREE queues).
* When a particular queue does not have a free page, iterate nearby queues
start at +/- 1 (before we started at +/- PQ_L2_SIZE/2), in an attempt to
retain as much locality as possible. This won't be perfect but it should
be good enough.
* Also fix an issue with the idlezero counters.
Summary of changes:
sys/kern/subr_cpu_topology.c | 26 ++++++++++++++++++
sys/sys/cpu_topology.h | 4 +++
sys/sys/globaldata.h | 3 ++-
sys/vm/vm_object.c | 16 +++++++++--
sys/vm/vm_page.c | 63 +++++++++++++++++++++++++++++++++++++-------
5 files changed, 100 insertions(+), 12 deletions(-)
DragonFly BSD source repository
More information about the Commits