From owner-svn-src-projects@FreeBSD.ORG Tue Feb 26 15:46:37 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 71EDBBF0; Tue, 26 Feb 2013 15:46:37 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com [IPv6:2a00:1450:4010:c03::235]) by mx1.freebsd.org (Postfix) with ESMTP id 99336B11; Tue, 26 Feb 2013 15:46:36 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id fr10so3953046lab.26 for ; Tue, 26 Feb 2013 07:46:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=F4yo9OIl4O0Y2fAGTsZeAbD1z4oGNAIDGRCwsnAdLx4=; b=b9ilrRsVfnkvyOfI8ISHEzXFODgtonuUK6lj/8L3IXWkIwk/U8CG8fKtZpBFKcIhR6 5PsJg9QSDLvdUy6i11R6bWlkFuMHLLc2AKGaYSdf9/dAJyBvDKhugGQmKyU9PrUPqCnE 9THY4f2ptJNi4wlhjLIPQ5yiSRfnkS3wWZVxEfDhqyECIgXqDGU3HcwCO5rviBhFxUE4 HJJncjjghDu51Xgkohv3yqShZ7S6MGeF2E1Zaf/PU2Eb3Gg599U1RqJwWa8UuQ8SjOcE Dg8alKZY/GZv3hFnzIG3chhBIkLv7PZINNScRjIT9ptdefgZ5kW1rFI3chYCQasWj6Fz Mrhw== X-Received: by 10.152.104.36 with SMTP id gb4mr14142557lab.13.1361893595385; Tue, 26 Feb 2013 07:46:35 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id f4sm656939lbo.4.2013.02.26.07.46.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Feb 2013 07:46:34 -0800 (PST) Sender: Alexander Motin Message-ID: <512CD8D7.60306@FreeBSD.org> Date: Tue, 26 Feb 2013 17:46:31 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130125 Thunderbird/17.0.2 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r247319 - in projects/calloutng/sys: kern sys References: <201302261525.r1QFPhLt058080@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 15:46:37 -0000 On 26.02.2013 17:28, Attilio Rao wrote: > On Tue, Feb 26, 2013 at 4:25 PM, Alexander Motin wrote: >> Author: mav >> Date: Tue Feb 26 15:25:43 2013 >> New Revision: 247319 >> URL: http://svnweb.freebsd.org/changeset/base/247319 >> >> Log: >> Optimize callout_process() to use less variables and less conditions to >> implement the same logic. Now it fits better into CPU registers, and >> according to PMC significntly reduces number of resource stalls, reducing >> consumed by it CPU time during usleep(1) benchmark by 30%. > > Is that all improved i-cache capacity and improved dynamic branch > prediction (hwpmc has counters for both FWIW)? I-cache capacity I think is not significant there as the loop is quite small. I believe it was branch misprediction, complicated by additional latency of memory accesses. I haven't analyzed cause deeper, as PMC man pages are not the most informative and easiest reading. -- Alexander Motin