public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Poole <mdpoole@troilus.org>
To: Vlad <vladc6@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Noatime vs relatime
Date: Fri, 10 Aug 2007 10:51:58 -0400	[thread overview]
Message-ID: <87bqdffnn5.fsf@graviton.dyn.troilus.org> (raw)
In-Reply-To: <233939.75965.qm@web54403.mail.yahoo.com> (Vlad's message of "Fri\, 10 Aug 2007 07\:26\:46 -0700 \(PDT\)")

Vlad writes:

> Relatime seems to be wasteful of both IO resources _and_ CPU cycles.
> Instead of performing a single IO operation (as atime does), relatime
> performs at least three IO operations and three CPU-dependent
> operations:
>
> 1) a read IO operation to find out the old atime
> 2) a read IO operation to find out the old ctime
> 3) a read IO operation to find out the old mtime
> 4) Comparison of "old atime is <= than mtime/ctime"
> 5) Find out current time
> 6) Comparison of "current time minus old atime is > X"
>
> People are going to wonder why all of the sudden everything is running
> so slow due to atimes being updated after a long break.

Filesystems deal with block devices, which have fairly large (at least
512-byte) read and write granularity.  Sane filesystems have atime,
ctime and mtime all in the same block, so one read gets all three.
The file's metadata would be in the cache while it's open anyway.

CPU operations are many orders of magnitude faster than block I/O, so
if steps 4-6 eliminate even a fraction of a percent of atime
writebacks, relatime is a net benefit.  In practice, most files are
read many more times than they are written, and most of those are
eliminated even with step #6.  Academic journals abound with
storage-related studies of read versus write patterns (often including
temporal locality of reference) for various kinds of files; I refer
you to those for details.

Michael.

  parent reply	other threads:[~2007-08-10 15:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-10 14:26 Noatime vs relatime Vlad
2007-08-10 14:44 ` Xavier Bestel
2007-08-10 14:47 ` Arjan van de Ven
2007-08-10 14:51 ` Michael Poole [this message]
2007-08-10 15:10 ` Matti Aarnio
2007-08-10 22:55   ` Rene Herman
2007-08-10 19:29 ` Bill Davidsen
  -- strict thread matches above, loose matches on Subject: below --
2007-08-10 16:32 pointman
     [not found] <8QDOX-78C-15@gated-at.bofh.it>
     [not found] ` <8QErs-8dz-1@gated-at.bofh.it>
     [not found]   ` <8QLCI-2zy-15@gated-at.bofh.it>
2007-08-11  8:33     ` Bodo Eggert

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=87bqdffnn5.fsf@graviton.dyn.troilus.org \
    --to=mdpoole@troilus.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vladc6@yahoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox