From owner-cvs-all@FreeBSD.ORG Mon Sep 12 16:45:58 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8D64616A41F; Mon, 12 Sep 2005 16:45:58 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by mx1.FreeBSD.org (Postfix) with ESMTP id D5DB443D46; Mon, 12 Sep 2005 16:45:57 +0000 (GMT) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (0x535c0e2a.sgnxx1.adsl-dhcp.tele.dk [83.92.14.42]) by pasmtp.tele.dk (Postfix) with ESMTP id 76A471EC325; Mon, 12 Sep 2005 18:45:56 +0200 (CEST) To: Jung-uk Kim From: "Poul-Henning Kamp" In-Reply-To: Your message of "Mon, 12 Sep 2005 12:40:49 EDT." <200509121240.51775.jkim@FreeBSD.org> Date: Mon, 12 Sep 2005 18:45:52 +0200 Message-ID: <11401.1126543552@phk.freebsd.dk> Sender: phk@phk.freebsd.dk Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/kern vfs_subr.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Sep 2005 16:45:58 -0000 In message <200509121240.51775.jkim@FreeBSD.org>, Jung-uk Kim writes: >Please make sure to use `time_uptime' if you need monotonic timestamp. >Especially many network stacks seem to make sequence IDs and >timestamps to expire from `time_second' instead of time_uptime. >time_second is not guaranteed to be monotonic! time_uptime is. > >http://docs.freebsd.org/cgi/mid.cgi?8153.1126340565 >http://docs.freebsd.org/cgi/mid.cgi?20050909214808.GA6021 I would like to add that this is *also* true for userland where uptime is called clock_gettime(CLOCK_MONOTONIC,...). Please consider carefully, if you need a timestamp for a certain time of day or just a certain inverval of time measured from now. In the latter case, it is _always_ uptime/CLOCK_MONOTONIC you want. Failure to do this means that your program/kernel code will do the wrong thing when the clock is stepped (manually or by NTP). -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.