Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751145Ab0HQTbx (ORCPT ); Tue, 17 Aug 2010 15:31:53 -0400 Received: from fieldses.org ([174.143.236.118]:56307 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750705Ab0HQTbq (ORCPT ); Tue, 17 Aug 2010 15:31:46 -0400 Date: Tue, 17 Aug 2010 15:29:38 -0400 From: "J. Bruce Fields" To: Alan Cox Cc: "Patrick J. LoPresti" , Andi Kleen , linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-kernel Subject: Re: Proposal: Use hi-res clock for file timestamps Message-ID: <20100817192937.GD26609@fieldses.org> References: <87aaolwar8.fsf@basil.nowhere.org> <20100817174134.GA23176@fieldses.org> <20100817182920.GD18161@basil.fritz.box> <20100817190447.GA28049@fieldses.org> <20100817203941.729830b7@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100817203941.729830b7@lxorguk.ukuu.org.uk> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1777 Lines: 46 On Tue, Aug 17, 2010 at 08:39:41PM +0100, Alan Cox wrote: > > The problem with "increment mtime by a nanosecond when necessary" is > > that timestamps can wind up out of order. As in: > > Surely that depends on your implementation ? > > > 1) Do a bunch of operations on file A > > 2) Do one operation on file B > > > > Imagine each operation on A incrementing its timestamp by a nanosecond > > "just because". If all of these operations happen in less than 4 ms, > > you can wind up with the timestamp on B being EARLIER than the > > timestamp on A. That is a big no-no (think "make" or anything else > > relying on timestamps for relative times). > > > [time resolution bits of data][value incremented value for that time] > > > if (time_now == time_last) > return { time_last , ++ct }; > else { > ct = 0; > time_last = time_now > return { time_last , 0 }; > } > > providing it is done with the same 'ct' across the fs and you can't do > enough ops/second to wrap the nanosecs - which should be fine for now, > your ordering is still safe is it not ? Right, so if I understand correctly, you're proposing a time source that's global to the filesystem and that guarantees it will always return a unique value by incrementing the nanoseconds field if jiffies haven't changed since the last time it was called. (Does it really need to be global across all filesystems? Or is it unreasonable to expect your unbelievably-fast make's to behave well when sources and targets live on different filesystems?) --b. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/