From owner-freebsd-hackers@freebsd.org Sat Jul 25 13:25:35 2015 Return-Path: Delivered-To: freebsd-hackers@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 766DC9AA6E4 for ; Sat, 25 Jul 2015 13:25:35 +0000 (UTC) (envelope-from deco33000@yandex.com) Received: from forward12p.cmail.yandex.net (forward12p.cmail.yandex.net [87.250.241.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAF51BC0 for ; Sat, 25 Jul 2015 13:25:34 +0000 (UTC) (envelope-from deco33000@yandex.com) Received: from web8g.yandex.ru (web8g.yandex.ru [95.108.252.108]) by forward12p.cmail.yandex.net (Yandex) with ESMTP id E766421F82 for ; Sat, 25 Jul 2015 16:25:29 +0300 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web8g.yandex.ru (Yandex) with ESMTP id 934BC5740F41; Sat, 25 Jul 2015 16:25:29 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1437830729; bh=7UdaMu6kYr3OW4qBqJB4/Vvdbtc7KLBGKuIpM+AtMEY=; h=From:To:Subject:Date; b=IFCAgJVZtJ8WjLnlzFyATTMkRMEr2boi1S9A5al5KWM5jsT3kZeZJIwNWjQ2lJ9Ti iFyoAzG8KNzew8fQaFZkzYS4uNXNwKT9TJt4oDzzZ4XT/6Idd4foJCrfDmUvUZ/jTy MA7IS6eS3qF6FkDPikFBYDR9WN7zDrjMMD2y198w= Received: by web8g.yandex.ru with HTTP; Sat, 25 Jul 2015 16:25:29 +0300 From: deco33000@yandex.com To: freebsd-hackers@freebsd.org Subject: Timekeeping between two hardclocks MIME-Version: 1.0 Message-Id: <1226791437830729@web8g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sat, 25 Jul 2015 15:25:29 +0200 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jul 2015 13:25:35 -0000 Hello, I am learning the freebsd way to keep the time up to date. I already read http://phk.freebsd.dk/pubs/timecounter.pdf I am mostly in sys/kern_tc.c We avoid to call hardware hardclock() every time we need a timestamp by applying some math (to improve performance). I get the idea. But, how do we know how far we are from the last hardclock(), at any given moment? Are the updates to the "fake" timestamps occuring at a constant rate? Is there a feed somewhere I missed? I don't see where in that case. This is the last -and most important- point I don't get on the timer/clock subsystem. I seriously need your help/pointers I guess. Thanks --š Jog