From owner-svn-src-all@FreeBSD.ORG Fri Mar 30 12:31:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A70001065670; Fri, 30 Mar 2012 12:31:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id EDF1C8FC15; Fri, 30 Mar 2012 12:31:11 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1SDazQ-000G2r-Pj; Fri, 30 Mar 2012 16:31:36 +0400 Date: Fri, 30 Mar 2012 16:31:36 +0400 From: Slawa Olhovchenkov To: Alexander Motin Message-ID: <20120330123136.GF61230@zxy.spb.ru> References: <201203281137.q2SBb65O033656@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203281137.q2SBb65O033656@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r233599 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Mar 2012 12:31:12 -0000 On Wed, Mar 28, 2012 at 11:37:06AM +0000, Alexander Motin wrote: > Author: mav > Date: Wed Mar 28 11:37:06 2012 > New Revision: 233599 > URL: http://svn.freebsd.org/changeset/base/233599 > > Log: > MFC r232207, r232454: > 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. > > Sponsored by: iXsystems, Inc. Nice! Now X3430 completely silent in idle system.