Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jun 2015 08:11:48 +0000 (GMT)
From:      jenkins-admin@freebsd.org
To:        jenkins-admin@FreeBSD.org, freebsd-current@freebsd.org
Subject:   FreeBSD_HEAD-tests - Build #1083 - Fixed
Message-ID:  <1160690749.52.1433491908728.JavaMail.jenkins@jenkins-9.freebsd.org>
In-Reply-To: <2030674114.50.1433460982630.JavaMail.jenkins@jenkins-9.freebsd.org>
References:  <2030674114.50.1433460982630.JavaMail.jenkins@jenkins-9.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
FreeBSD_HEAD-tests - Build #1083 - Fixed:

Check console output at https://jenkins.freebsd.org/job/FreeBSD_HEAD-tests/1083/ to view the results.
From owner-freebsd-current@FreeBSD.ORG  Fri Jun  5 11:38:22 2015
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by hub.freebsd.org (Postfix) with ESMTPS id 48D05A76
 for <freebsd-current@freebsd.org>; Fri,  5 Jun 2015 11:38:22 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id CEE11133A
 for <freebsd-current@freebsd.org>; Fri,  5 Jun 2015 11:38:21 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from tom.home (kostik@localhost [127.0.0.1])
 by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id t55BcGSO064884
 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
 Fri, 5 Jun 2015 14:38:16 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua t55BcGSO064884
Received: (from kostik@localhost)
 by tom.home (8.14.9/8.14.9/Submit) id t55BcGe5064883;
 Fri, 5 Jun 2015 14:38:16 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Fri, 5 Jun 2015 14:38:16 +0300
From: Konstantin Belousov <kostikbel@gmail.com>
To: Hans Petter Selasky <hps@selasky.org>
Cc: FreeBSD Current <freebsd-current@freebsd.org>
Subject: Re: [CFR] Replacing while loops with proper division and
 multiplication
Message-ID: <20150605113816.GB2499@kib.kiev.ua>
References: <55714B26.6060802@selasky.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <55714B26.6060802@selasky.org>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.1
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/>;
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 05 Jun 2015 11:38:22 -0000

On Fri, Jun 05, 2015 at 09:09:26AM +0200, Hans Petter Selasky wrote:
> Hi,
> 
> I was going through some timer code and found some unnecessary while 
> loops in kern/kern_clocksource.c .
> 
> I added some prints and found that during boot, "runs" can exceed 2000, 
> while during regular usage runs is typically 1. Do you think it is worth 
> to convert these loops into division and multiplications? It might make 
> the CPU pipeline a tiny bit faster, having to skip some conditionals? 
> And also possibly improve readability?
For typical loop count of one, I think that setup time for the division is
much greater than single substraction and non-taken conditional jump, which
is also should be consistently predicted as not taken.

You could try to run a microbenchmark to see if the patch makes any sense.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1160690749.52.1433491908728.JavaMail.jenkins>