From owner-freebsd-current@FreeBSD.ORG Sun Oct 30 17:10:23 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B5521065670 for ; Sun, 30 Oct 2011 17:10:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9CF8FC18 for ; Sun, 30 Oct 2011 17:10:22 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p9UHAFEj057224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 30 Oct 2011 19:10:15 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p9UHAFbw019626 for ; Sun, 30 Oct 2011 19:10:15 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p9UHAFvI019625 for current@freebsd.org; Sun, 30 Oct 2011 19:10:15 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 30 Oct 2011 19:10:15 +0200 From: Kostik Belousov To: current@freebsd.org Message-ID: <20111030171015.GR50300@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gCjauHB7LOSWqPxs" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: x86: how to get maximum possible CPU frequency ? 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: Sun, 30 Oct 2011 17:10:23 -0000 --gCjauHB7LOSWqPxs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Assume we are running on the single-package X86 machine, how to answer the question: what is the possible maximum tsc frequency ? I read tsc_levels_changed(), is it the right way to query the max frequency for the general purpose driver ? If yes, could the code be made into the utility function ? BTW, there is some usage of the barriers in sysctl_machdep_tsc_freq() that I do not understand. When the read from tsc_freq is performed with the acquire semantic ? Why there are two store barriers when tsc_freq and tsc_timecounter.tc_frequency are written ? I would think that a single barrier on the last write is enough, but is it needed at all ? --gCjauHB7LOSWqPxs Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6thPYACgkQC3+MBN1Mb4iCEACgjX9e2TBMIx1K078YHRqObpfM NOsAn3xZjU5+AYSwWkhpXNzpAAqT52y9 =QWqW -----END PGP SIGNATURE----- --gCjauHB7LOSWqPxs--