From owner-freebsd-stable@freebsd.org Thu Jul 23 15:28:49 2015 Return-Path: Delivered-To: freebsd-stable@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 3F55E9A819B for ; Thu, 23 Jul 2015 15:28:49 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) by mx1.freebsd.org (Postfix) with SMTP id 1EF4C1FC6 for ; Thu, 23 Jul 2015 15:28:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 23 Jul 2015 15:26:49 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t6NFSdAT009525; Thu, 23 Jul 2015 09:28:39 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1437665319.1334.519.camel@freebsd.org> Subject: Re: struct timehands: th_generation field From: Ian Lepore To: Brandon Allbery Cc: deco33000@yandex.com, freebsd-stable Date: Thu, 23 Jul 2015 09:28:39 -0600 In-Reply-To: References: <464641437658995@web16j.yandex.ru> <190031437662308@web29g.yandex.ru> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jul 2015 15:28:49 -0000 On Thu, 2015-07-23 at 10:59 -0400, Brandon Allbery wrote: > On Thu, Jul 23, 2015 at 10:38 AM, wrote: > > > Is the maximum value for th_generation equal to 10 ? > > http://fxr.watson.org/fxr/source/kern/kern_tc.c?v=FREEBSD10#L77 > > > > I don't think those relate to generations. Generations change on every > clock tick; the multiple timehands structs relate to forcibly setting the > time, as opposed to the clock moving forward normally. It does appear serve > a similar purpose, since forcibly setting the time is even more "violent" > (to anything currently reading the clock) than advancing the clock on a > clock tick, since that's when other adjustments including possibly > switching the clock source will be applied. > Ummm, no. The multiple timehands and related generation count are all about time moving forward normally, and doing so without needing mutxes or other locking primitives to obtain the current time. I think you guys need to read this... http://phk.freebsd.dk/pubs/timecounter.pdf Especially the section named "Locking, lack of..." -- Ian