From owner-freebsd-amd64@freebsd.org Sun Jul 26 21:00:38 2015 Return-Path: Delivered-To: freebsd-amd64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BEC19A955B for ; Sun, 26 Jul 2015 21:00:38 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8C1B1BE2 for ; Sun, 26 Jul 2015 21:00:37 +0000 (UTC) (envelope-from bugzilla-noreply@FreeBSD.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t6QL0b3U002769 for ; Sun, 26 Jul 2015 21:00:37 GMT (envelope-from bugzilla-noreply@FreeBSD.org) Message-Id: <201507262100.t6QL0b3U002769@kenobi.freebsd.org> From: bugzilla-noreply@FreeBSD.org To: freebsd-amd64@FreeBSD.org Subject: Problem reports for freebsd-amd64@FreeBSD.org that need special attention X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 Date: Sun, 26 Jul 2015 21:00:37 +0000 Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Sun, 26 Jul 2015 21:27:36 +0000 X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2015 21:00:38 -0000 To view an individual PR, use: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=(Bug Id). The following is a listing of current problems submitted by FreeBSD users, which need special attention. These represent problem reports covering all versions including experimental development code and obsolete releases. Status | Bug Id | Description ------------+-----------+--------------------------------------------------- Open | 141413 | [hang] Tyan 2881 m3289 SMDC freeze 1 problems total for which you should take action. From owner-freebsd-amd64@freebsd.org Sat Aug 1 05:32:32 2015 Return-Path: Delivered-To: freebsd-amd64@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EAC39B16C8 for ; Sat, 1 Aug 2015 05:32:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::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 55F011809 for ; Sat, 1 Aug 2015 05:32:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (75-48-78-19.lightspeed.cncrca.sbcglobal.net [75.48.78.19]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5CEF9B980; Sat, 1 Aug 2015 01:32:31 -0400 (EDT) From: John Baldwin To: freebsd-amd64@freebsd.org Subject: Re: kernel timers and clocks Date: Fri, 31 Jul 2015 10:40:16 -0700 Message-ID: <6399789.W1exljHUsy@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-PRERELEASE; KDE/4.14.3; amd64; ; ) In-Reply-To: <239381437645154@web15m.yandex.ru> References: <239381437645154@web15m.yandex.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 01 Aug 2015 01:32:31 -0400 (EDT) X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2015 05:32:32 -0000 On Thursday, July 23, 2015 11:52:34 AM deco33000@yandex.com wrote: > Hello, > > I am trying to figure out how timers work for the amd64 platform on freebsd 10. > > How the kernel manage the timers? is it using TSC? The kern.timecounter sysctl tree shows the available timercounters (and information about each one) as well as which one is currently being used. Note that timecounters are used to compute the uptime and time-of-day for get*time and *time as well as gettimeofday() and clock_gettime() in userland. There is another timer interface used to manage interval timers. This uses timer interrupts to terminate sleeps, and things like setitimer(), alarm(), etc. (also the timeouts for select(2) and poll(2), etc.). These can be examined via the kern.eventtimer sysctl tree. In some cases the same hardware can be used for both purposes, but not always. On x86 it is common to use the TSC for the timecounter and the local APIC timer for the event timer. > I see lot of functions using getnanotime and friend but I don't get how they work. > They just iterate over time and read a volatile value. Where/how is that value kept updated? Every so often an event timer interrupt triggers the tc_windup() function in kern_tc.c. That function updates the timehands structure used by getnanotime() and friends. -- John Baldwin