From: NeilBrown <neilb@suse.de>
To: Andi Kleen <andi@firstfloor.org>
Cc: Matt Mackall <mpm@selenic.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Nanosecond fs timestamp support: sad
Date: Fri, 22 Jul 2011 16:33:35 +1000 [thread overview]
Message-ID: <20110722163335.2df4f6ca@notabene.brown> (raw)
In-Reply-To: <m2pql2c0qz.fsf@firstfloor.org>
On Thu, 21 Jul 2011 23:01:24 -0700 Andi Kleen <andi@firstfloor.org> wrote:
> Matt Mackall <mpm@selenic.com> writes:
>
>
> > This means I can touch a file something like 70k times per second and
> > get only 300 distinct timestamps on my laptop. And only 100 distinct
> > timestamps on a typical distro server kernel.
>
> You should use the inode generation number if you really want
> to see every update.
I assume you mean i_version which gets incremented (under a spinlock) if the
filesystem asks for it.
This doesn't let you compare the ages of two files. I wonder if that is
important. Is it important to you Matt?
>
> > Meanwhile, I can call gettimeofday 35M times per second and get ~1M
> > distinct responses.
>
> They key word here is "I".
>
> > Given that we can do gettimeofday three orders of magnitude faster than
> > we can do file transactions and it has four orders of magnitude better
> > resolution, shouldn't we be using it for filesystem time when
> > sb->s_time_gran is less than 1/HZ?
>
> Some systems have a quite slow gettimeofday()
> That was the primary motivation for using jiffies.
>
> Also adding more granuality makes it more expensive,
> because there's additional work every time it changes.
> Even jiffies already caused regressions.
>
> -Andi
I imagine a scheme where 'stat' would set a flag if it wasn't set, and
file_update_time would:
- if the flag is set, use gettimeofday and clear the flag
- if the flag is not set, use jiffies
so if you are looking, you will see i_mtime changing precisely but if not,
you don't pay the price.
This wouldn't allow precise ordering of distinct files either of course.
NeilBrown
next prev parent reply other threads:[~2011-07-22 6:33 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-21 18:07 Nanosecond fs timestamp support: sad Matt Mackall
2011-07-22 6:01 ` Andi Kleen
2011-07-22 6:33 ` NeilBrown [this message]
2011-07-22 19:34 ` Matt Mackall
2011-07-22 20:59 ` Andi Kleen
2011-07-22 21:11 ` Matt Mackall
2011-07-22 21:47 ` Andi Kleen
2011-07-22 22:10 ` J. Bruce Fields
2011-07-22 22:31 ` J. Bruce Fields
2011-07-22 22:59 ` NeilBrown
2011-07-22 23:06 ` J. Bruce Fields
2011-07-22 23:49 ` J. Bruce Fields
2011-07-23 0:07 ` NeilBrown
2011-07-23 0:07 ` Matt Mackall
2011-07-23 1:38 ` J. Bruce Fields
2011-07-23 2:10 ` Trond Myklebust
2011-07-24 1:56 ` Andi Kleen
2011-07-29 19:49 ` Pavel Machek
2011-07-29 21:37 ` Matt Mackall
2011-07-23 1:13 ` Andreas Dilger
2011-07-25 15:09 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110722163335.2df4f6ca@notabene.brown \
--to=neilb@suse.de \
--cc=andi@firstfloor.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.