svn commit: r322942 - head/sys/kern
Conrad Meyer
cem at FreeBSD.org
Sun Aug 27 05:14:49 UTC 2017
Author: cem
Date: Sun Aug 27 05:14:48 2017
New Revision: 322942
URL: https://svnweb.freebsd.org/changeset/base/322942
Log:
Improve scheduler performance
Improve scheduler performance by flattening nonsensical topology layers
(layers with only one child don't serve any purpose).
This is especially relevant on non-AMD Zen systems after r322776. On my
dual core Intel laptop, this brings the kern.sched.topology_spec table down
from three levels to two.
Submitted by: jeff
Reviewed by: attilio
Sponsored by: Dell EMC Isilon
Modified:
head/sys/kern/subr_smp.c
Modified: head/sys/kern/subr_smp.c
==============================================================================
--- head/sys/kern/subr_smp.c Sun Aug 27 03:10:16 2017 (r322941)
+++ head/sys/kern/subr_smp.c Sun Aug 27 05:14:48 2017 (r322942)
@@ -630,6 +630,15 @@ smp_topo(void)
panic("Built bad topology at %p. CPU mask (%s) != (%s)",
top, cpusetobj_strprint(cpusetbuf, &top->cg_mask),
cpusetobj_strprint(cpusetbuf2, &all_cpus));
+
+ /*
+ * Collapse nonsense levels that may be created out of convenience by
+ * the MD layers. They cause extra work in the search functions.
+ */
+ while (top->cg_children == 1) {
+ top = &top->cg_child[0];
+ top->cg_parent = NULL;
+ }
return (top);
}
More information about the svn-src-all
mailing list