From owner-freebsd-stable@FreeBSD.ORG Wed Jun 13 14:49:31 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A80001065672 for ; Wed, 13 Jun 2012 14:49:31 +0000 (UTC) (envelope-from daniel@digsys.bg) Received: from smtp-sofia.digsys.bg (smtp-sofia.digsys.bg [193.68.3.230]) by mx1.freebsd.org (Postfix) with ESMTP id 29E028FC08 for ; Wed, 13 Jun 2012 14:49:30 +0000 (UTC) Received: from dcave.digsys.bg (dcave.digsys.bg [192.92.129.5]) (authenticated bits=0) by smtp-sofia.digsys.bg (8.14.5/8.14.5) with ESMTP id q5DEnFTx011860 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 13 Jun 2012 17:49:17 +0300 (EEST) (envelope-from daniel@digsys.bg) Message-ID: <4FD8A86B.4010802@digsys.bg> Date: Wed, 13 Jun 2012 17:49:15 +0300 From: Daniel Kalchev User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.5) Gecko/20120607 Thunderbird/10.0.5 MIME-Version: 1.0 To: Momchil Ivanov References: <861ulkkflm.wl%momchil@xaxo.eu> <201206121203.q5CC3AA2002709@lurza.secnetix.de> <86zk88isor.wl%momchil@xaxo.eu> In-Reply-To: <86zk88isor.wl%momchil@xaxo.eu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Re: ULE Scheduler X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 14:49:31 -0000 On 12.06.12 16:08, Momchil Ivanov wrote: > So the L2 cache is shared between both cores and hence it's size does > not matter at all? If the cache is shared between both cores then it does not matter on which core the process runs, as long as data is in teh case. The cache size is irrelevant. Some CPUs have shared cache between cores, some don't. The ULE scheduler takes this into account, the 4BSD does not. Even if the ULE scheduler takes the CPU topology into consideration, if you only have two cores, it is almost guaranteed that processes will be switched between both, because the OS is running way more than two processes "at the same time". Even with more cores... it is not guaranteed an computational process won't be 'bouncing'. Here is an example. Suppose you have an 8 core (or threads) CPU. If you happen to have an modern Ethernet controller, like the Intel 82576 (the igb driver in FreeBSD), then it will use up to 8 interrupt lines, by default routing them each to a different core. Then, if you have heavier network traffic, chances are that at any given moment all 8 interrupts might be fired and all 8 cores switched to service network traffic -- removing your computational process from the running queue. The next time it runs, it might run on any other core, especially if the cache is not shared. Of course, if you have sufficiently large number of CPUs, you can configure your system so that such things do not happen, like by limiting the number of cores the igb driver attaches to, and have some of the cores dedicated to 'only' running an computational task. There is however, very little sense doing so. Daniel