From owner-freebsd-current@FreeBSD.ORG Thu Nov 3 20:43:46 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F021065670; Thu, 3 Nov 2011 20:43:46 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5D05E8FC18; Thu, 3 Nov 2011 20:43:45 +0000 (UTC) Received: by gyd5 with SMTP id 5so1079243gyd.13 for ; Thu, 03 Nov 2011 13:43:45 -0700 (PDT) Received: by 10.42.168.202 with SMTP id x10mr6241270icy.4.1320351460146; Thu, 03 Nov 2011 13:17:40 -0700 (PDT) Received: from [72.253.42.56] ([72.253.42.56]) by mx.google.com with ESMTPS id z10sm12237818ibv.9.2011.11.03.13.17.37 (version=SSLv3 cipher=OTHER); Thu, 03 Nov 2011 13:17:39 -0700 (PDT) Date: Thu, 3 Nov 2011 10:17:48 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Andriy Gapon In-Reply-To: <4E720CB6.3070103@FreeBSD.org> Message-ID: References: <4E720CB6.3070103@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@FreeBSD.org Subject: Re: couple of sched_ule issues X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2011 20:43:46 -0000 On Thu, 15 Sep 2011, Andriy Gapon wrote: > > This is more of a "just for the record" email. > I think I've already stated the following observations, but I suspect that they > drowned in the noise of a thread in which I mentioned them. > > 1. Incorrect topology is built for single-package SMP systems. > That topology has two levels ("shared nothing" and "shared package") with exactly > the same CPU sets. That doesn't work well with the rebalancing algorithm which > assumes that each level is a proper/strict subset of its parent. > > 2. CPU load comparison algorithms are biased towards lower logical CPU IDs. > With all other things being equal the algorithms will always pick a CPU with a > lower ID. This creates certain load asymmetry and predictable patterns in load > distribution. If all other things truly are equal why does selecting a lower cpu number matter? > > Another observation. > It seems that ULE makes a decision about thread-to-CPU affinity at the time when a > thread gets switched out. This looks logical from the implementation point of > view. But it doesn't seem logical from a general point of view - when the thread > will be becoming running again its affinity profile may become completely > different. I think that it would depend on how much a thread actually spends not > running. The decision is made at sched_add() time. sched_pickcpu() does the work and selects the run-queue we will be added to. We consider the CPU that the thread was last running on but the decision is made at the time that a run queue must be selected. Jeff > > -- > Andriy Gapon > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >