From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 15 20:06:39 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1832F106566C; Wed, 15 Feb 2012 20:06:39 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4E46F8FC16; Wed, 15 Feb 2012 20:06:38 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so1188654wib.13 for ; Wed, 15 Feb 2012 12:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=A0ZI7P3pepifISsi73sLfYBXK8QqJ8SDXdplwMaS+Q8=; b=YjcfXSEkYItCB5WCtTwU3OvpiUHkTixpHRXvJpCzXqUKLlCIc8qDip4vdKVzQ5wS1u HgSX0EuiyyaM9i/DdT4SaclXfu/2Y+SrEZxsapdRXDAQEqZJpsDZazY4U3NtHo+wSt2K YcIdRmYRAj3uzmiPQi42MBauzejapDJGl4vWA= Received: by 10.216.137.88 with SMTP id x66mr12292980wei.8.1329336397518; Wed, 15 Feb 2012 12:06:37 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id n5sm15175897wiw.7.2012.02.15.12.06.35 (version=SSLv3 cipher=OTHER); Wed, 15 Feb 2012 12:06:36 -0800 (PST) Sender: Alexander Motin Message-ID: <4F3C104A.4020805@FreeBSD.org> Date: Wed, 15 Feb 2012 22:06:34 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111227 Thunderbird/9.0 MIME-Version: 1.0 To: Jeff Roberson References: <4F2F7B7F.40508@FreeBSD.org> <4F366E8F.9060207@FreeBSD.org> <4F367965.6000602@FreeBSD.org> <4F396B24.5090602@FreeBSD.org> <4F3978BC.6090608@FreeBSD.org> <4F3990EA.1080002@FreeBSD.org> <4F3C0BB9.6050101@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org, Florian Smeets , Andriy Gapon Subject: Re: [RFT][patch] Scheduling for HTT and not only X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Feb 2012 20:06:39 -0000 On 02/15/12 21:54, Jeff Roberson wrote: > On Wed, 15 Feb 2012, Alexander Motin wrote: >> As before I've tested this on Core i7-870 with 4 physical and 8 >> logical cores and Atom D525 with 2 physical and 4 logical cores. On >> Core i7 I've got speedup up to 10-15% in super-smack MySQL and >> PostgreSQL indexed select for 2-8 threads and no penalty in other >> cases. pbzip2 shows up to 13% performance increase for 2-5 threads and >> no penalty in other cases. > > Can you also test buildworld or buildkernel with a -j value twice the > number of cores? This is an interesting case because it gets little > benefit from from affinity and really wants the best balancing possible. > It's also the first thing people will complain about if it slows. I'll do it, but even now I can say that existing balancing algorithm requires improvements to better handle SMT. If I understand correctly, present code never takes the last running thread from it's CPU. It is fine for non-SMT systems, but with SMT it may cause imbalance and as result reduced total performance. While current pickcpu() algorithm should be precise enough, its decision can be easily affected by some microsecond transient load, such as interrupt threads, etc, and results of that decision may be effective for seconds. -- Alexander Motin