From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 17 16:29:51 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 D703E106566C; Fri, 17 Feb 2012 16:29:51 +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 D40DC8FC13; Fri, 17 Feb 2012 16:29:50 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so2567374wib.13 for ; Fri, 17 Feb 2012 08:29:49 -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=KXP8UYjbyB7nX9YzAUF/Mjb573NLU1We0x8InHGqndw=; b=MqkjOKBp7OtB8EhNYAS/sn7Re/ZQhEEzDs2wiuiN5sDyVuYCHPZhGu/8vD1ljUgRnP 3lcuVbDPVXFTRIL4M92Uj3wwbdfWTN9ZYF0cbG6MOVzRleJRON9kpa9uoxDms/DjRhc8 S9VZU01BM6Jm2YLfOiHcMixSrfbJZuZu/dsgc= Received: by 10.180.85.105 with SMTP id g9mr4888423wiz.12.1329496189748; Fri, 17 Feb 2012 08:29:49 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id da8sm8698841wib.6.2012.02.17.08.29.47 (version=SSLv3 cipher=OTHER); Fri, 17 Feb 2012 08:29:48 -0800 (PST) Sender: Alexander Motin Message-ID: <4F3E807A.60103@FreeBSD.org> Date: Fri, 17 Feb 2012 18:29:46 +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 , FreeBSD current 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: Fri, 17 Feb 2012 16:29:51 -0000 On 02/15/12 21:54, Jeff Roberson wrote: > On Wed, 15 Feb 2012, Alexander Motin wrote: >> I've decided to stop those cache black magic practices and focus on >> things that really exist in this world -- SMT and CPU load. I've >> dropped most of cache related things from the patch and made the rest >> of things more strict and predictable: >> http://people.freebsd.org/~mav/sched.htt34.patch > > This looks great. I think there is value in considering the other > approach further but I would like to do this part first. It would be > nice to also add priority as a greater influence in the load balancing > as well. I haven't got good idea yet about balancing priorities, but I've rewritten balancer itself. As soon as sched_lowest() / sched_highest() are more intelligent now, they allowed to remove topology traversing from the balancer itself. That should fix double-swapping problem, allow to keep some affinity while moving threads and make balancing more fair. I did number of tests running 4, 8, 9 and 16 CPU-bound threads on 8 CPUs. With 4, 8 and 16 threads everything is stationary as it should. With 9 threads I see regular and random load move between all 8 CPUs. Measurements on 5 minutes run show deviation of only about 5 seconds. It is the same deviation as I see caused by only scheduling of 16 threads on 8 cores without any balancing needed at all. So I believe this code works as it should. Here is the patch: http://people.freebsd.org/~mav/sched.htt40.patch I plan this to be a final patch of this series (more to come :)) and if there will be no problems or objections, I am going to commit it (except some debugging KTRs) in about ten days. So now it's a good time for reviews and testing. :) -- Alexander Motin