]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r232207, r232454, r234066:
authormav <mav@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 6 Oct 2012 12:25:13 +0000 (12:25 +0000)
committermav <mav@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 6 Oct 2012 12:25:13 +0000 (12:25 +0000)
commit349c3c3bd16cc655dd789a556d3d879294f004c7
tree93eeb52ba92ab12cf19175b6088591e9829c16ce
parentaa9a2f6170db05d1c5604587caa90b7d2cb43c2d
MFC r232207, r232454, r234066:
Rework CPU load balancing in SCHED_ULE:
 - In sched_pickcpu() be more careful taking previous CPU on SMT systems.
Do it only if all other logical CPUs of that physical one are idle to avoid
extra resource sharing.
 - In sched_pickcpu() change general logic of CPU selection. First
look for idle CPU, sharing last level cache with previously used one,
skipping SMT CPU groups. If none found, search all CPUs for the least loaded
one, where the thread with its priority can run now. If none found, search
just for the least loaded CPU.
 - Make cpu_search() compare lowest/highest CPU load when comparing CPU
groups with equal load. That allows to differentiate 1+1 and 2+0 loads.
 - Make cpu_search() to prefer specified (previous) CPU or group if load
is equal. This improves cache affinity for more complicated topologies.
 - Randomize CPU selection if above factors are equal. Previous code tend
to prefer CPUs with lower IDs, causing unneeded collisions.
 - Rework periodic balancer in sched_balance_group(). With cpu_search()
more intelligent now, make balansing process flat, removing recursion
over the topology tree. That fixes double swap problem and makes load
distribution more even and predictable.

All together this gives 10-15% performance improvement in many tests on
CPUs with SMT, such as Core i7, for number of threads is less then number
of logical CPUs. In some tests it also gives positive effect to systems
without SMT.

git-svn-id: svn://svn.freebsd.org/base/stable/8@241246 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/sched_ule.c