[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0fDM_ceEnpFcy7P9KoBABQuEnxKkzUPb_cqT4QHL=fOw@mail.gmail.com>
Date: Fri, 16 Mar 2018 10:19:23 +0100
From: Arnd Bergmann <arnd@...db.de>
To: "Theodore Y. Ts'o" <tytso@....edu>, Arnd Bergmann <arnd@...db.de>,
Andiry Xu <jix024@....ucsd.edu>,
"Darrick J. Wong" <darrick.wong@...cle.com>,
Linux FS Devel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>,
Dan Williams <dan.j.williams@...el.com>,
"Rudoff, Andy" <andy.rudoff@...el.com>, coughlan@...hat.com,
Steven Swanson <swanson@...ucsd.edu>,
Dave Chinner <david@...morbit.com>, Jan Kara <jack@...e.com>,
swhiteho@...hat.com, miklos@...redi.hu,
Jian Xu <andiry.xu@...il.com>, Andiry Xu <jix024@...ucsd.edu>
Subject: Re: [RFC v2 03/83] Add super.h.
On Fri, Mar 16, 2018 at 3:59 AM, Theodore Y. Ts'o <tytso@....edu> wrote:
> On Thu, Mar 15, 2018 at 09:38:29PM +0100, Arnd Bergmann wrote:
>>
>> You could also have a resolution of less than a nanosecond. Note
>> that today, the file time stamps generated by the kernel are in
>> jiffies resolution, so at best one millisecond. However, most modern
>> file systems go with the 64+32 bit timestamps because it's not all
>> that expensive.
>
> It actually depends on the architecture and the accuracy/granularity
> of the timekeeping hardware available to the system, but it's possible
> for the granularity of file time stamps to be up to one nanosecond.
> So you can get results like this:
>
> % stat unix_io.o
> File: unix_io.o
> Size: 55000 Blocks: 112 IO Block: 4096 regular file
> Device: fc01h/64513d Inode: 19931278 Links: 1
> Access: (0644/-rw-r--r--) Uid: (15806/ tytso) Gid: (15806/ tytso)
> Access: 2018-03-15 18:09:21.679914182 -0400
> Modify: 2018-03-15 18:09:21.639914089 -0400
> Change: 2018-03-15 18:09:21.639914089 -0400
Note how the nanoseconds only differ in digits 2, 7, 8, and 9 though:
The atime update happened 4 jiffies (at HZ=100) after the mtime,
the low digits are presumably jitter or ntp adjustments.
This is the result of current_time() using the plain tk_xtime
rather than reading the highres clocksource as ktime_get_real_ts64()
does.
This was a performance optimization a long time ago. We could
make the current_time() behavior configurable if we want though,
e.g. at compile time, or as a per-mount option. It's probably more
common these days to have a highres clocksource that can
be read efficiently than it was back when current_fs_time()
was first introduced.
Arnd
Powered by blists - more mailing lists