Slashdot Mirror


Replacing Atime With Relatime in the Kernel

eldavojohn writes "Our friend Jeremy at the Kernal Trap has dug up some interesting criticism of atime from Linus Torvalds. As Linus submitted patches to improve relatime he noted: 'I cannot over-emphasize how much of a deal it is in practice. Atime updates are by far the biggest IO performance deficiency that Linux has today. Getting rid of atime updates would give us more everyday Linux performance than all the pagecache speedups of the past 10 years, _combined_.' And later severely beat atime about the head with a pointed stick: 'It's also perhaps the most stupid Unix design idea of all times. Unix is really nice and well done, but think about this a bit: 'For every file that is read from the disk, lets do a ... write to the disk! And, for every file that is already cached and which we read from the cache ... do a write to the disk!'" Well, I guess I can expect my Linux machine to become a little bit faster!"

416 comments

  1. Personally by Nikron · · Score: 5, Interesting

    After I mounted my system with nodiratime and noatime, I did not 'feel' any actual speed increase. I didn't did any hard testing of course.

    --
    Disclaimer: Disregard the above post.
    1. Re:Personally by ciroknight · · Score: 4, Informative

      I can't "feel" a difference on my desktop with 2GB of RAM, but on my laptop which only has 1, and a much slower disk, the improvement is pretty noticeable (as in from "nearly unusable for lots of access applications [trackerd]" to "smooth as silk").

      It's funny the kernel devs are just now talking about this, I discovered this almost 6 months ago on the Ubuntu forums while glancing around for a fix for my laptop's ridiculous sound issues.

      --
      "Victory means exit strategy, and it's important for the President to explain to us what the exit strategy is." G.W.Bush
    2. Re:Personally by Anonymous Coward · · Score: 3, Interesting

      What's more is that any performance sensitive partition is already mounted with noatime and nodiratime flags. It's only ever going to be a performance issue for those that neglect to turn it off.

      atime is useful for deleting files from working directories, I use it on my laptop graphic design partition. Anything untouched for 2 months is deleted by a shell script to free up space. The backups and archives are also mounted with atime, its usefulness to me in this role far outweighs the performance penalty.

    3. Re:Personally by Burz · · Score: 4, Informative

      I discovered noatime about 5 years ago, right about the same time I learned that DMA was turned off by default. I was horrified to hear that Linus' opinion of DMA at the time was 'no performance gain'.

      I'm surprised Linus is just cluing in now about atime updates: The noatime workaround is listed in all kinds of performance-tuning guides.

    4. Re:Personally by Trepalium · · Score: 4, Informative

      For a laptop, there is a more important reason to use noatime. Without that option the hard drives may never get the chance to spin down and save power because /bin/sync always has something to write to the disk (it's own atime update).

      --
      I used up all my sick days, so I'm calling in dead.
    5. Re:Personally by sortius_nod · · Score: 3, Informative

      I just enabled it on my little file server at home.

      Specs:
      AMD 3000+, 512MB ram, 1x 80GB IDE, 2x 500GB SATA (Raid)

      MASSIVE difference in performance, even just doing an ls on a directory with a lot of files/directories in it.

    6. Re:Personally by Suicyco · · Score: 3, Informative

      Try it on a multi terabyte high speed raid0 for scratch data on a big box like a 64 cpu altix. noatime can give massive, and by massive I mean MASSIVE speed increases. atime is retarded, I totally agree with Linus.

    7. Re:Personally by cthulhu11 · · Score: 1, Informative

      Turning it off (or using fastfs) can substantially improve the speed of a filesytem restore.

    8. Re:Personally by GnuDiff · · Score: 1

      On one of the servers I had been administering we had around 5+ million file filesystem (of ~50k and 5k files). Turning off atime was a great speed increase. That, and using XFS (vs eg Reiser or ext3).

    9. Re:Personally by WNight · · Score: 2, Interesting

      I checked what was mounted and found an extrernal 500GB via USB without noatime so I decided to try a test.

      I ran a 'find . > /dev/null' on the external drive. There were 250k files totallying roughly 450GB on ReiserFS.

      The first run took 50s, then it quickly stabilized between 1.5s and 6.5s, mostly around 4s. The cache obviously made a huge difference.

      Then I remounted with noatime and reran the test. It was very consistently at just under 0.7s.

      So, between 1.08 times faster and 6.4 times depending on if the reads are already cached.

    10. Re:Personally by snemarch · · Score: 1

      Try using 'find' instead of locate and search through your entire filesystem - you should be able to tell the difference with and without the "noatime" option, especially if you don't have a 10.000rpm drive. I've been using the NT equivalent (NtfsDisableLastAccessUpdate) since win2000, and I use noatime on linux/bsd boxes as well.

      --
      Coffee-driven development.
    11. Re:Personally by sqldr · · Score: 1

      We once had a mail server where some wag's buggy code managed to fill it with about 3 million emails. While it was choking on that, about 5000 legit emails got stuck in the queue on it.

      Adding noatime sped up delivery of those 5000 by about 60%.

      --
      I wrote my first program at the age of six, and I still can't work out how this website works.
    12. Re:Personally by Anonymous Coward · · Score: 1, Informative

      Been doing this on NTFS (Windows NT-based OS (NT 3.51, NT 4.0, 2000/XP/Server 2003)) for more than a decade now, via this registry parameter (alongside others I do not need, like DOS backwards compatibility, as all my programs are Win32 ones nowadays, for example):

      [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr ol\FileSystem]
      "NtfsDisable8dot3NameCreation"=dword:00000001
      "Win31FileSystem"=dword:00000000
      "Win95TruncatedExtensions"=dword:00000001
      "AsyncFileCommit"=hex:01
      "ContigFileAllocSize"=dword:00001000
      "DisableLastAccessUpdate"=dword:00000001
      "DisablePagingExecutive"=dword:00000001
      "NtfsDisableLastAccessUpdate"=dword:00000001
      "Disable8dot3NameCreation"=dword:00000001


      Some of those today, might be legacy support OR invalid for NT-based OS (like ones for Win9x would be), which is no biggie, because if they are invalid parameters? They only get read @ system startup, & if invalid, they're ignored (penalty = SUPER-MINOR registry bloat, 1-N lines @ most)...

      (Specifically, ones like like Win31 filesystem & DOS 8.3 naming being kept up to date, especially since normal "DOS" can't even READ NTFS, without addons, for example, will help since modern OS & filesystems can use, what? 254 characters in their names? Why keep the DOS entry then in the MFT$? An unnecessary write))

      STILL, those entries above for NTFS filesystem performance control?

      They, for the MOST part if not all, all ought to still be totally function & USEFUL for performance' sake, nowadays even.

      If I am "off" on ANY of those above? Correct me if needed - things DO go "out of date" in this field, very quickly, but those SHOULD still be ok, & of SOME performance-enhancing gains as well.

      (... & every LITTLE BIT, helps, when you optimize for performance STRICTLY, more on the trade off below! Much like a mustache (each hair doesn't count for much, but, put them all together, you have VISIBLE results you CAN SEE/NOTICE, easily)).

      The 'downside' would be for access tracking: When each file may have been used/touched etc. for security purposes.

      (Trade off = speed, vs. POSSIBLE security uses)

      APK

      P.S.=> I've been doing this for more than a DECADE now on NTFS & Windows NT-based OS - I am personally surprised that folks from the *NIX world (especially the penguins) have NOT caught onto & applied this decades ago as well... note the trade offs though (speed, vs. security potentials really)! apk

    13. Re:Personally by BitZtream · · Score: 1

      What calls sync other than a user? AFAIK, sync asks the kernel to flush the write cache, the kernel itself wouldn't call sync, so no atime change on it. Somethings wrong if you're running sync manually or from a script at regular intervals, its the kernels job to figure out when to flush the cache.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    14. Re:Personally by dougmc · · Score: 1
      ... except that it should have no difference in doing a simple ls on a directory. The only entry you're directly accessing (and therefore updating it's atime) is the directory itself. Even `ls -l' does have to stat() everything in a directory, but stat() by itself does not update atimes.


      Now, under cygwin, ls -l *does* open each file, because it's attempting to find out if it's executable or not, but I hope you're not talking about ls under cygwin.

      The performance increase you're seeing is probably due to caching somehow rather than anything related to atime.

    15. Re:Personally by Anonymous Coward · · Score: 0

      the noatime, nodiratime options in fstab really help alot in my laptop. Previously X11's mouse cursor would not move smoothly and when compiling or apt-getting things the mouse cursor was completely unusable. noatime fixed the problem completely. And now browsing the web is much faster. Very nice.

    16. Re:Personally by mr_mischief · · Score: 1

      If it's a recursive ls (ls -R) and there are a lot of directories, it might make a difference. There's still reason to suspect caching made the difference, though.

  2. Ummm.. by Anonymous Coward · · Score: 2, Funny

    Since I have no idea what atime or relatime actually are, could someone just tell me which kernel settings should be changed re: this story for an ideal desktop system?

    Thanks.

    1. Re:Ummm.. by Anonymous Coward · · Score: 1, Funny

      "Since I have no idea what atime or relatime actually are..."

      For starters
      $ man mount

    2. Re:Ummm.. by AKAImBatman · · Score: 3, Informative

      This is talking about the Last Access Time feature of most Unix systems. The OS will write a timestamp to disk each time the file is opened, closed, changed, or just looked at funny. Most professional Unixes (Solaris springs to mind) have the option of disabling the access timestamps. I haven't read the article yet, so I'm not quite sure why Linux hasn't followed suit by now. It's a security feature that's not all that useful on most systems.

    3. Re:Ummm.. by Anonymous Coward · · Score: 0

      man mount
      grep noatime

    4. Re:Ummm.. by mpeg4codec · · Score: 2, Informative

      In your /etc/fstab, append noatime to the options of your main file systems. This will prevent the access timestamps of files and directories from being updated on each access. Not so sure what the relatime stuff is, but I imagine the use of noatime will also prevent the bottlenecks seen from relatime.

    5. Re:Ummm.. by ArcherB · · Score: 5, Informative
      In your /etc/fstab, add noatime to your options portion of you drive line. For example:

      /media/sda1 ext3 defaults,noatime 1 1 atime logs when a file has been written or read. So every time a file is used, it has to write an entry on the HDD, slowing performance, but it can have uses, like in forensics, security or backups (if a file has not been read in three years, it's probably safe to archive and move off the drive). I don't care for it, so I have the noatime line in my fstab.

      --
      There is no "I disagree" mod for a reason. Flamebait, Troll, and Overrated are not substitutes.
    6. Re:Ummm.. by megaditto · · Score: 1

      They are talking about keeping track of (read) access times for files on your disk. I am not sure why Linus makes such a big deal about this since writing out the access times is deferred until some other write, anyways.

      You don't really need to change any kernel settings, just set the noatime flag for your disk if you don't need the functionality.

      --
      Obama likes poor people so much, he wants to make more of them.
    7. Re:Ummm.. by Compholio · · Score: 5, Informative

      Most professional Unixes (Solaris springs to mind) have the option of disabling the access timestamps. I haven't read the article yet, so I'm not quite sure why Linux hasn't followed suit by now.
      Linux has had the capability to turn off access timestamps for a long time. "man mount" has details, but all you really have to do is edit /etc/fstab:
      /dev/hda3 / ext3 defaults 0 1
      becomes
      /dev/hda3 / ext3 defaults,noatime,nodiratime 0 1
    8. Re:Ummm.. by mikeee · · Score: 4, Insightful

      Deferred, maybe, but not for more than a few seconds, and when it happens it means more disk seeks...

      It's long been standard practice to disable this on, eg, news/mail spools (anything with large numbers of read-mostly small files). The new plan of, if I understand correctly, only updating atime when the file is modified or if the new atime is more than 24 hours after the current atime should provide nearly the same functionality with practically none of the performance hit.

    9. Re:Ummm.. by Anonymous Coward · · Score: 0, Troll

      I'm not quite sure why Linux hasn't followed suit by now. Perhaps if you knew the first thing about Linux, you'd know that it has had this option - for at least the last 10 years.

      But don't let the complete lack of knowlege on a particular topic stop you from posting about it.
    10. Re:Ummm.. by AKAImBatman · · Score: 3, Interesting

      Yeah, I finally read the article. I thought I remembered that Linux could turn off atime, but I wasn't going to commit to it until I was sure.

      FWIW, the Relative Access Time (relatime) patch simply doesn't update the access time unless the file has been modified since the last atime write. That allows ancient applications like MUTT to still synchronize on various files. Synchronization that does not work with noatime set.

      Of course, I have to question why they're still using something as ancient as MUTT. A nice event system would be 1000x more efficient than trying to synchronize on flat files stored in your home directory on the file system. Of course, that would require designing OSes beyond the standard UNIX/POSIX philosophy and design. So I doubt we'll see that in Linux any time soon.

    11. Re:Ummm.. by sholden · · Score: 0, Troll

      So you committed to it not having it, even though you weren't sure and vaguely though it might? "I'm not quite sure why Linux hasn't followed suit by now" is declaring that Linux hasn't followed suit.

    12. Re:Ummm.. by AKAImBatman · · Score: 2, Insightful

      you'd know that it has had this option - for at least the last 10 years.

      I did know, but not off the top of my head. I haven't mucked around at that level for quite a while now. Given that the summary seemed to imply that Linux did *not* have noatime support (which would be quite an odd thing indeed) I was not ready to challenge it until I actually read the article. Of course, it was a case of bad-summary-itis. (Again.)

      As it so happens, TFA is an exercise in the danger of pulling from a conversation with little context to back it up. The only reason why they are discussing the matter is because a few programs like MUTT still use atime to synchronize their operation. If it weren't for MUTT (and presumably a few other unmentioned examples) I imagine that atime would be off by default by now.
    13. Re:Ummm.. by AKAImBatman · · Score: 1

      "I haven't read the article yet..."

      Not much of a commitment, there. The summary implied that notime was not supported. Do you disagree that it doesn't?

      Go find bigger fish to fry.

    14. Re:Ummm.. by obsolete1349 · · Score: 1

      When I used Gentoo on my box (3 years overall), I always used noatime and nodiratime. There's no point for it in a desktop computer. However, it's extremely useful for logs and other things on servers.

    15. Re:Ummm.. by Anonymous Coward · · Score: 0

      When you make regular backups, atime is probably a useless field.

    16. Re:Ummm.. by Kjella · · Score: 1

      If you don't need accurate atime, then you don't need atime... then you need some sort of "access-o-meter" saying how often this file is in use. That file I've accessed once in the last year shouldn't be updated for fast access even if atime is five minutes ago, so what's it for? Nothing good that I can tell.

      --
      Live today, because you never know what tomorrow brings
    17. Re:Ummm.. by Anonymous Coward · · Score: 0

      A nice event system would be 1000x more efficient than trying to synchronize on flat files stored in your home directory on the file system. Of course, that would require designing OSes beyond the standard UNIX/POSIX philosophy and design. So I doubt we'll see that in Linux any time soon.

      What do the crummy characteristics of ancient mail applications have to do with unix in general?

      The unix philosophy is "everything is a file" (and frankly, plan9 beats it there). /dev/poll is a file. Use it.

    18. Re:Ummm.. by m1ndrape · · Score: 0

      is there a way to compare performance metrics with it on and off?

      --
      Donald Ray Moore Jr. (mindrape)
      Suspected Terrorist
    19. Re:Ummm.. by ashayh · · Score: 1

      I believe noatime includes nodiratime.

    20. Re:Ummm.. by mce · · Score: 2, Interesting

      It's good for finding files that are not being accessed anymore (doh). This may not be a big issue on a personal desktop, but in a corporate network with tons of centrally installed tools - and even more versions thereof - it very much is. I've made in the past extensive use of it for exactly that purpose.

      It's also good for automatically getting rid of the many defunct temporary files people tend to leave behind in shared directories such as /tmp. Again think multi-user machines.

      I've also used it as a debugging feature. Both to debug software and to de bug wetware (i.e. brains of people who are convinced they are telling their computer to do one thing while actually telling it something else).

    21. Re:Ummm.. by Anonymous Coward · · Score: 0

      The new plan of, if I understand correctly, only updating atime when the file is modified...

      Umm, that's mtime. atime is last access time, mtime is last modification. There are times you want see the last time a file was accessed, so I hope that atime doesn't go away completely. I need to RTFA to see what's really being proposed here.

    22. Re:Ummm.. by vidarh · · Score: 5, Insightful
      People are using Mutt because it works and has the features lots of people needs. I have to question why people keep upgrading just for the sake of it. As for an event system, Linux has had that too for ages - search for dnotify and inotify.

      However Mutt's use of atime simply is cheap enough that there's simply never been a reason to change it all the time most people have had atime updates on anyway. If it ain't broke, don't fix it.

    23. Re:Ummm.. by JavaBear · · Score: 1

      Cant we have a Cached atime for those who really want the feature?
      Cache the atimes in memory, probably even dump them to the journal along with the next journal write and commit/write them to disk when there are some idle time on the drive.

    24. Re:Ummm.. by sholden · · Score: 0, Troll

      The commitment was in the part I quoted. That's why I quoted it.

      I disagree, the title is pretty much a give away as to whether linux has atime or not.

    25. Re:Ummm.. by Michael+Woodhams · · Score: 1

      It sounds like the package management software could deal with this. By default, mount all disks "noatime". For each package, note whether it uses atimes. If you install a package which uses atimes, the default mounting is changed (and you're warned about the performance hit.)

      I suppose some common tools like 'find' would need to be modified to not require atimes, and to use them only if available.

      --
      Quattuor res in hoc mundo sanctae sunt: libri, liberi, libertas et liberalitas.
    26. Re:Ummm.. by Carcass666 · · Score: 1

      I wonder if this is among the "first things" to know about Linux, how it will ever become widespread on the desktop...

    27. Re:Ummm.. by doti · · Score: 1

      I still use mutt on the server I admin.
      It's a tremendously powerful email client, no other comes even close.

      For personal email I use Gmail or Thunderbird, thought.

      --
      factor 966971: 966971
    28. Re:Ummm.. by Anonymous Coward · · Score: 3, Informative

      "/dev/hda3 / ext3 defaults,noatime,nodiratime 0 1"
      Actually, noatime is a superset of nodiratime, so there is no need to specify both.

    29. Re:Ummm.. by Cheesey · · Score: 4, Interesting

      Of course, I have to question why they're still using something as ancient as MUTT.

      The thing I really *really* like about Mutt is that it uses Unix mailbox files. These are not just human-readable, they can also be manipulated using tools like 'cat'. I periodically archive my working mail files into a backup directory by just concatenating the working files onto the archive files of the same name. The resulting archive mail files are still fully usable with Mutt, even though some are 100Mb+ in size with mail going back to 1997. I could also use them with even older mail clients such as Pine, but that would be like using vi when you've got vim.

      When I initially began using Linux, I used the Netscape email software, got fed up with it, and tried a few other mail clients. But none of them came close to the flexibility of Mutt. They all used their own mailbox formats, which could not be archived in the way I just described. I suspect that this is still true. I'm not going to trust Opera, Sylpheed, Thunderbird or Evolution with my mail, because (a) I doubt present-day mail files will still work reliably in 10 years time, (b) I can't easily migrate to another mail reader, and (c) I can't efficiently archive my email because the database files are not plain text.

      That's why I like Mutt, anyway.

      --
      >north
      You're an immobile computer, remember?
    30. Re:Ummm.. by nschubach · · Score: 5, Funny

      $ man mount

      How can anyone write that with a straight face?
      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    31. Re:Ummm.. by Fweeky · · Score: 3, Interesting

      That allows ancient applications like MUTT to still synchronize on various files Mutt uses atime to cheaply determine if there are new files in a mbox, without needing to keep external metadata or scan for flags; if atime < mtime, put a 'N' in the index. Given atime's required by POSIX, and it's a non-critical feature I don't really see why this is a problem; it's not like it's the end of the world if it doesn't work. Maybe mutt could be explicit about wanting atime updated using utime(), or you could add a folder-hook to touch -a a mbox on open, assuming that still works on noatime mounts.

      It's also commonly used by cleanup scripts to delete rarely accessed temp files and such. I'm sure there are plenty of scripts in production dotted around doing things like find -atime +7 -delete, some probably quite recent.

      Of course, I have to question why they're still using something as ancient as MUTT Err, because it's a nice mail client? Do you also want to question why we're still using bourne compatible shells, vi derivatives, or Perl? Also, it's spelled "mutt" or "Mutt", not "MUTT". Anyone would think you were trolling...
    32. Re:Ummm.. by myowntrueself · · Score: 3, Interesting

      or backups (if a file has not been read in three years, it's probably safe to archive and move off the drive)

      Ummmm... if you are doing regular backups then the atime will be changing every time so you can't tell if the file has not *really* been read in three years.

      So atime is only useful in the case that you havn't backed that file up in three years and it has never even been accessed in that time... at which point I have to ask why you are only now deciding to archive it to offline media, if its relevence is really that low?

      --
      In the free world the media isn't government run; the government is media run.
    33. Re:Ummm.. by billcopc · · Score: 1

      Extremely useful ? Yes. Extremely replaceable ? Hell yes.

      I run everything with noatime, the tradeoff is that for the handful of scenarios where I do need some sort of access time, I just have to store it elsewhere. For web logs, that timestamp is stored in the SQL DB along with the rest of my log processor's data, that way I can choose when to update it, only when it needs to be and without affecting every other file on my server.

      Sure, there's a small performance hit on the DB, but with the large quantity of data transfer I go through, I'm sure the noatime benefits me far more than the cost of a DB transaction.

      --
      -Billco, Fnarg.com
    34. Re:Ummm.. by cortana · · Score: 1

      I think that 'nodiratime' has no effect if you set 'noatime'.

      Down with cargo-culting! :)

    35. Re:Ummm.. by wytcld · · Score: 1

      a few programs like MUTT still use atime to synchronize their operation
      Odd. Been using mutt continuously for years on noatime mounted file systems. And it's been working errorlessly. What's supposed to be broken for me?

      There was a mutt version maybe a decade back that lost some e-mails on me from its flat files. But ever since then it's rock solid.
      --
      "with their freedom lost all virtue lose" - Milton
    36. Re:Ummm.. by Wyzard · · Score: 1

      That idea was brought up in the discussion on the list, but Theodore Tso pointed out "that it will keep a large number of inodes pinned in memory, which is its own problem. So there would have to be some way to force the atime updates to be merged when under memory pressure, and and perhaps on some much longer background interval (i.e., every hour or so)."

      So, it's possible, but not as straightforward to implement as one might think.

    37. Re:Ummm.. by PopeRatzo · · Score: 4, Funny

      I have the noatime line in my fstab.
      Ah, these are the kind of stories I first starting coming to Slashdot for.

      I don't think you can fully realize how poetic a phrase such as the one above can be until you read it with absolutely no understanding, as I do.

      Thank you, ArcherB and thank you, Slashdot.
      --
      You are welcome on my lawn.
    38. Re:Ummm.. by TheRaven64 · · Score: 1

      I'm not sure if this is fixed on Windows, but your comment has reminded me of an amusing bug I recall seeing on DOS many years ago. Reading the access time of a file had an ordering problem, where the act of reading the access time would set the access time to now before reading it. If you used a hex disk editor you could see access times, but if you tried reading them via the filesystem then you just got the current time back.

      --
      I am TheRaven on Soylent News
    39. Re:Ummm.. by Anonymous Coward · · Score: 0

      It IS broke when atime is off.

    40. Re:Ummm.. by ScrewMaster · · Score: 1

      Microsoft's NTFS has a similar timestamping feature that can be disabled with a (huge surprise) registry entry. It does seem to make a difference on slower systems.

      I know, I know ... off-topic.

      --
      The higher the technology, the sharper that two-edged sword.
    41. Re:Ummm.. by orasio · · Score: 1

      I wonder if this is among the "first things" to know about Linux, how it will ever become widespread on the desktop...

      Kernels have nothing to do with desktops.
      Mount options are not the first thing to know about Linux, but they are about the first.
    42. Re:Ummm.. by SirTalon42 · · Score: 1

      I think what he means is atime will only be updated if the the old if the files been modified since the last atime (well, probably at the same time as the last mtime, that way you can just tell if its been read since being written).

    43. Re:Ummm.. by cyber-dragon.net · · Score: 1

      Not all that useful? Have you ever tried to write a backup or sync script without it?

    44. Re:Ummm.. by siride · · Score: 2, Interesting

      You could use a bind mount on the mail directory with atime enabled.

      mount -o atime --bind /path/to/maildir /path/to/maildir

    45. Re:Ummm.. by profplump · · Score: 1

      You could simply choose not to entrust your local mail client with the authoritive copy of your mail archive.

      I agree with your preference for easy-to-parse formats -- I prefer maildir myself, as I find it easier to address individual messages programatically when they have their own files -- I'm just saying that the local storage format is not an issue if you don't put your mail client in charge of your message archive.

    46. Re:Ummm.. by hab136 · · Score: 3, Informative

      The old Netscape 4.x software also used Unix mailbox (mbox) files; it just also had index files. I'm not sure about current versions. mbox plus index was/is a popular storage format - mbox because it was simple, with added indexes for speed.

      Maildir is my preferred format - each message is a separate plain text file, which means no locking issues, and simultaneous access from multiple machines. You can just tar the directory up if you want to move it, or cat all the files together if you want mbox back. You can use maildir with mutt (and lots of other software).

    47. Re:Ummm.. by twistedcubic · · Score: 1

      Mutt is ancient? If Mutt is ancient, then Linux is really ancient. You should probably upgrade to Windows Vista.

    48. Re:Ummm.. by Anonymous Coward · · Score: 0

      I did know, but not off the top of my head. Uh, yeah right. And I know everything there is to

      Got news for you - when you have to look something up then you don't know it. You may have known it at some time in the past, but you've forgotten, and no longer know it.

      I would have had more respect for you if you would have just admitted you were wrong, instead of trying to come up with some Bushesque explanation.

      Given that the summary seemed to imply that Linux did *not* have noatime support (which would be quite an odd thing indeed) I was not ready to challenge it until I actually read the article. Ahh, so it was odd enough that you didn't go to check, but it wasn't odd enough for you to imply that Linux is not "professional", and generally make slams against it based on something you didn't actually know.

      And of course, you did actually challenge it. (Nice attempt to rewrite history there, BTW.)

      Of course, it was a case of bad-summary-itis. (Again.) Oh of course. It's the summary's fault that you made a complete ass of yourself. It has nothing to do with the fact that you actually typed something into that comment box and hit "Submit" - that had nothing at all to do with it.

      Wake me when you can take responsibility for your mistakes.
    49. Re:Ummm.. by stonedcat · · Score: 0

      man touch && touch balls && rm balls

      --
      You can't take the sky from me.
    50. Re:Ummm.. by Doctor+Memory · · Score: 1

      Mount options are not the first thing to know about Linux, but they are about the first. And as long as this is true, Linux will not be ready for the desktop. I don't want to have to dick around with how my filesystems are mounted any more than I want to dick around with how the wheel camber on my car is set up. People don't want to give their car a four-wheel alignment before they can drive it home, nor do they want to have to deal with the intricacies of file system mounting.
      --
      Just junk food for thought...
    51. Re:Ummm.. by whimmel · · Score: 1

      I found it useful when I discovered (but have not yet confronted) my current girlfriend viewed nude pictures of my ex-girlfriend that were in an obscure folder on my Mac. The access times were while I was at work.

      --
      Does the name Pavlov ring a bell?
    52. Re:Ummm.. by Anonymous Coward · · Score: 0

      Either you are Andrew Morton(Hi!! :)) himself or you are one of the people like me who read lkml even better than 99.99% /.ers here. :-)

    53. Re:Ummm.. by Dadoo · · Score: 1

      Ummmm... if you are doing regular backups then the atime will be changing every time

      Ummm... No. Not if you use the appropriate options on your backup command, such as the "--atime-preserve" option on "tar". I wish they'd add that option to "rsync".

      --
      Sit, Ubuntu, sit. Good dog.
    54. Re:Ummm.. by porl · · Score: 2, Insightful

      and how is this any different from following all those guides out there that document how to use the windows registry to fine-tune performance? just because there is an option to change atime settings doesn't mean that it is a requirement to do so just to 'use linux on the desktop'

      sorry, but i'm sick to death of these sorts of claims. actually try to use it before you start making claims such as this.

    55. Re:Ummm.. by Anonymous Coward · · Score: 0

      Of course, I have to question why they're still using something as ancient as MUTT.

      Because they haven't discovered the elegant beauty of PINE.

      I've been using pine since 1992 or so. I love it - fast & simple. Nothing annoys an exchange admin like using Pine with imap/ssl to read your email.

      I think there are about 20 of us Pine users left!

    56. Re:Ummm.. by misleb · · Score: 5, Funny

      How can anyone write that with a straight face?


      I'm sure it was written with a gay face.

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    57. Re:Ummm.. by Anonymous Coward · · Score: 0

      Evolution uses plain mbox format; you can delete the extra files and it will recreate them. The extra files contain indexes and status flags.

    58. Re:Ummm.. by wirelessbuzzers · · Score: 1

      You could use a bind mount on the mail directory with atime enabled. Unfortunately, bind mounts don't take -o.
      --
      I hereby place the above post in the public domain.
    59. Re:Ummm.. by Anonymous Coward · · Score: 0

      Evolution uses mbox. It can be archived in the above manner. At least it could last I checked.

    60. Re:Ummm.. by Anonymous Coward · · Score: 1

      dnotify and inotify are crap:

      1) you can't monitor the whole filesystem (too many watches, too few devices)
      2) it drops updates if you do not read them fast enough and in that case you probably have to rescan everything you are monitoring.
      3) there is a race condition on monitoring new subfolders / mounts
      4) it violates access protection, because once you monitor a folder you can see anything that happens to it or in it even after permissions change.
      5) applications can't regularly use it because the number of devices is too small (they can't count on being able to use it).

      Why can't it do these things? For that matter why can't I have a pluggable security for some parts of the filesystem? Because all of this stuff has to cross the kernel <--> userspace barrier. All that stuff is absolutely trivial with a virtual machine in the kernel or better yet an OS written in a typesafe language running safe programs.

    61. Re:Ummm.. by Anonymous Coward · · Score: 0

      > but that would be like using vi when you've got vim

      As in, a blazing-fast instantly-opened low-overhead tool
      in the true Unix tradition ( it just edits text ) or a
      bloated development environment that nags me about orphans
      in Uganda and thinks I want to record a macro when I miskey?

      Hmmm, hard choice...

    62. Re:Ummm.. by jhol13 · · Score: 1

      How do I disable atime from USB disks? The fstab method does not work, not at least with Fedora Core 6.

    63. Re:Ummm.. by Myen · · Score: 1

      Current versions of Mozilla Thunderbird / Seamonkey still use mbox, yes. With *.msf index files (which can be blown away - you might end up losing some read state on newsgroup messages though).

    64. Re:Ummm.. by bytesex · · Score: 1

      Indeed, I _want_ atime for this purpose. Of course, I could mount /tmp on a different partition with atime enabled, whilst on the other partitions, it's off.

      --
      Religion is what happens when nature strikes and groupthink goes wrong.
    65. Re:Ummm.. by amRadioHed · · Score: 1

      Hmm, shouldn't she be the one confronting you?

      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
    66. Re:Ummm.. by 12357bd · · Score: 1

      dnotify anf inotify are really flawed.

      Sorry, but it's a shame that linux still doesn't have a proper file change notification, (one that does allow recursive subdirectory watches).

      The system knows whenever a program access a file, it has to verify the path at open time, so there's no excuse to not to have a decent watch detection system.

      --
      What's in a sig?
    67. Re:Ummm.. by Anonymous Coward · · Score: 0

      I suspect that this is still true. I'm not going to trust Opera, Sylpheed, Thunderbird or Evolution with my mail, because (a) I doubt present-day mail files will still work reliably in 10 years time, (b) I can't easily migrate to another mail reader, and (c) I can't efficiently archive my email because the database files are not plain text.

      Sylpheed uses plain MBOX or MailDir.

      Personally, I have fetchmail + procmail download my mail directly into sylpheeds mail directory, categorized into different folders according to .procmailrc. Spam even ens up in "Trash", which is set to delete on close in Sylpheed. So when I open Sylpheed I will have a chance to catch any mistakes, without needing to do anything to delete it.

    68. Re:Ummm.. by anno1602 · · Score: 1

      No need for "nodiratime", "noatime" includes that.

    69. Re:Ummm.. by siride · · Score: 1

      I tried it myself it it works fine. Perhaps a version issue?

    70. Re:Ummm.. by Anonymous Coward · · Score: 0

      This is the kind of elitist comments that keep Linux in the shade of the giant. Why don't you try helping noobs to become roXXors?

    71. Re:Ummm.. by Anonymous Coward · · Score: 0

      man mount
      grep noatime
      normaluser@Machine:~$ man mount
      No manual entry for mount
      normaluser@Machine:~$ grep noatime
      bash: grep: command not found
    72. Re:Ummm.. by Ash-Fox · · Score: 1

      And as long as this is true, Linux will not be ready for the desktop.
      It isn't true actually. Many people use Linux distributions without ever knowing mount options.

      I don't want to have to dick around with how my filesystems are mounted any more than I want to dick around with how the wheel camber on my car is set up.
      Speaking of cars. I find it annoying when the car doesn't start, it gives me warning lights for low fuel, battery low, oil low etc. When infact, none of these are the case.

      I find cars really not user friendly, hell, you need to have a license after training to even use one, this isn't the case with computers.

      nor do they want to have to deal with the intricacies of file system mounting.
      Honestly, I haven't seen anyone who actually needed to mess with those options except in very specialized situations (servers etc).
      --
      Change is certain; progress is not obligatory.
    73. Re:Ummm.. by kanelephant · · Score: 1

      You might be able to achieve what you want with chattr -A or chattr +A. (Probably in combination with -R). Eg chattr -R +A /usr/ should turn off atime updates on all of /usr

      I think it only works to turn off atime updates so you would need to mount with atime and then turn it off on the folders where you don't need it.

      (Warning the above is untested: but the LKML suggests it works as does the chattr man page)

      the /usr directory is one of the more important ones if you do any compiling as each compile accesses large numbers of files in /usr/include/

      K

    74. Re:Ummm.. by Compholio · · Score: 1

      How do I disable atime from USB disks? The fstab method does not work, not at least with Fedora Core 6.
      I have not tried to do that myself, but I see no reason why it should fail. Did you remount the drive? I'm wondering if Fedora auto-configuring the mount might mess things up, you could try:
      mount -o remount,noatime,nodiratime /media/usb
      How did you check to see if it worked? You can check to see the mount options of all mounted filesystems using:
      cat /etc/mtab
    75. Re:Ummm.. by diegocgteleline.es · · Score: 1

      mount -o remount,noatime /

    76. Re:Ummm.. by EvilRyry · · Score: 1

      I remember a really frustrating Windows '03 bug where my unnamed backup software wouldn't backup several files because they had an invalid ctime (somewhere in the early 1900's like 1908 or something). If I copied the file, the new copy had a valid ctime. If I deleted the old file, the new file had a valid ctime still (no surprises there). However if you then renamed the new file back to the name of the old file, it acquired all the old time stamps as the origonal old file! Even if you modified new file, the times would still revert. You could even make a totally different file and rename it to the origonal file name and this would happen.

      I eventually found a little app that allowed me to edit the time stamps, but it was very, very strange.

    77. Re:Ummm.. by Anonymous Coward · · Score: 0

      By the way, noatime is a superset of nodiratime.

    78. Re:Ummm.. by Random832 · · Score: 1

      I thought the read state in newsgroup messages was stored in the newsrc - As recently as a year ago I was able to synchronize (after a fashion... never got around to writing that merge tool) thunderbird with slrn by copying the newsrc files back and forth.

      --
      We've secretly replaced Slashdot with new Folgers Crystals - let's see if it notices.
    79. Re:Ummm.. by manifoldronin · · Score: 1

      Of course, I have to question why they're still using something as ancient as MUTT.


      You insensitive ...
      --
      Tyranny isn't the worst enemy of a democracy. Cynicism is.
    80. Re:Ummm.. by Eunuchswear · · Score: 1

      Yeah, but --atime-preserve updates the ctime!

      --
      Watch this Heartland Institute video
    81. Re:Ummm.. by BitZtream · · Score: 1

      If the backup utility uses stat on the file, the atime/mtime/ctime are all left unmodified. If the very act of looking at atime modified it, it would be rather pointless.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    82. Re:Ummm.. by flibble · · Score: 1

      I think there are about 20 of us Pine users left! That's because a load of us have already switched over to Alpine instead. ;-)
      --
      ZoeP
    83. Re:Ummm.. by jhol13 · · Score: 1

      Sure the remount works. But it would be nice if the automounter when mounting would mount it correctly. It seems the automounter (or whatever it actually is) does not read fstab :-(

      I checked it with "mount" command, it gives mounts and options when run without arguments (seems to give same information as /etc/mtab gives).

    84. Re:Ummm.. by berashith · · Score: 1

      man kill
      man bash

      these are my wife's favorites

    85. Re:Ummm.. by l4m3z0r · · Score: 1

      Of course, I have to question why they're still using something as ancient as MUTT.

      I specifically switched to mutt from thunderbird some months ago because thunderbird provides 0 features(useful) above what mutt has. Furthermore, once you know how to use mutt productivity shoots right up(imo). The most important "feature" of mutt is that I can access my email client from any machine that can I can run putty on(if it don't already have ssh).

      I find the idea of people labeling a program or technology as useless because it is old more than just silly its stupid(aka defective brain stupid). I use vim as my editor in all my coding projects work or otherwise, and people typically react the same way. vim is old don't use that!! When ultimately it still is the best tool for the job as far as im concerned.

    86. Re:Ummm.. by Dadoo · · Score: 1

      --atime-preserve updates the ctime

      Not on Linux: http://www.gnu.org/software/tar/manual/tar.html (search for "O_NOATIME").

      Besides, the way files are generally manipulated on Unix, ctime has limited value. At my current job, we even have a cron job that runs once a week, and updates all the permissions on all of our important files, just in case someone screwed them up, so here, ctime has practically no value at all. I'd rather have atime, thanks.

      --
      Sit, Ubuntu, sit. Good dog.
    87. Re:Ummm.. by Knuckles · · Score: 1

      Depending on distro, the automounting is probably done with pmount and dbus. You probably need to change/write a dbus rule.

      --
      "When I first heard Daydream Nation it quite frankly scared the living shit out of me." -- Matthew Stearns
    88. Re:Ummm.. by Knuckles · · Score: 1

      Because he has had a life before he met her?

      --
      "When I first heard Daydream Nation it quite frankly scared the living shit out of me." -- Matthew Stearns
    89. Re:Ummm.. by Knuckles · · Score: 1

      normaluser@Machine:~$ man mount
      No manual entry for mount

      Dude, fix your machine. You can't even boot (or your distro folks are insane).

      --
      "When I first heard Daydream Nation it quite frankly scared the living shit out of me." -- Matthew Stearns
    90. Re:Ummm.. by Anonymous Coward · · Score: 0

      If it ain't broke, don't fix it.
      But, it is broke. Didn't you read the article?
    91. Re:Ummm.. by Knuckles · · Score: 1

      is there a way to compare performance metrics with it on and off?/i

      Yeah, by comparing performance metrics with it on and off.

      --
      "When I first heard Daydream Nation it quite frankly scared the living shit out of me." -- Matthew Stearns
    92. Re:Ummm.. by m1ndrape · · Score: 0

      duh...i meant where are the numbers to prove it and not because it seems to be faster.

      --
      Donald Ray Moore Jr. (mindrape)
      Suspected Terrorist
    93. Re:Ummm.. by Eunuchswear · · Score: 1

      Ah --atime-preserve=system - interesting.

      But your crontab thingy is about the stupidest thing I've ever heard of!

      You need to look into tripwire or something like that.

      If the permissions on an important file are wrong you should be looking for intruders, not just hiding the problem with chmod.

      Christ, even klunky old SCO UnixWare will have a shitfit if the ctime on an "important" file changes.

      --
      Watch this Heartland Institute video
    94. Re:Ummm.. by Knuckles · · Score: 1

      RTFA

      --
      "When I first heard Daydream Nation it quite frankly scared the living shit out of me." -- Matthew Stearns
    95. Re:Ummm.. by Dadoo · · Score: 1

      If the permissions on an important file are wrong you should be looking for intruders

      Well, not in this case. Our main application (no, we didn't write it) was developed on DOS and ported to Unix, so it knows nothing about Unix permissions. As a result, they get screwed up, occasionally. The cron job fixes that. Yes, I know it's stupid, but we don't have much of a choice.

      Another cool (not!) artifact of the application's DOS-to-Unix conversion is that we have to use symbolic links to emulate drive letters, like "ln -s /u1/application/live L:"

      Neat, huh?

      --
      Sit, Ubuntu, sit. Good dog.
    96. Re:Ummm.. by Eunuchswear · · Score: 1

      Sorry, don't get it - if your app "knows nothing of Unix permissions" how does it screw things up?

      You mean you run it with the wrong umask?

      --
      Watch this Heartland Institute video
    97. Re:Ummm.. by mr_mischief · · Score: 1

      I think the idea was that he kept the pics after the new girlfriend became the new girlfriend. That upsets some people.

      Some will think it's just nice to have nudie pics, even if they are of an ex. If you're sure your SO isn't looking at them longingly and wishing to have the ex instead of you, it might be alright that the pics stay around.

      I'm surprised that he'd want to confront her if they both think it's okay for him to have them and look at them, though. She is probably just wondering if she measures up, wondering why he likes seeing the naked body of his ex when he has the new girlfriend, etc. Even if she's not insecure and confrontational about it, those are valid reasons for her to be curious.

      On the very bright side, it may mean his new girlfriend is thinking about being into guys and girls and might be open for a threesome. That's something he might not want to screw up by bitching about her attractions.

    98. Re:Ummm.. by orasio · · Score: 1

      Mount options are not the first thing to know about Linux, but they are about the first. And as long as this is true, Linux will not be ready for the desktop. I don't want to have to dick around with how my filesystems are mounted any more than I want to dick around with how the wheel camber on my car is set up. People don't want to give their car a four-wheel alignment before they can drive it home, nor do they want to have to deal with the intricacies of file system mounting. Ok. Again. Linux is not an operating system.
      Debian GNU/Linux is an operating system.
      Ubuntu is an operating system.
      SuSE Linux is an operating system.

      Linux is a kernel. Following your bad analogy, it is an engine, not a car.

      People who want to use SuSE don't need to know anything about Linux. Most people who want to know about Linux should learn about mount, since most Linuxes are used to mount stuff.
    99. Re:Ummm.. by usv · · Score: 1

      becomes
      /dev/hda3 / ext3 defaults,noatime,nodiratime 0 1 Hmm, isn't nodiratime included in the noatime option?
    100. Re:Ummm.. by wirelessbuzzers · · Score: 1
      Either that or the man page is wrong. I haven't tried it, but read the manual for mount-2.12r on 2.6.20:

      Note that the filesystem mount options will remain the same as those on
                    the original mount point, and cannot be changed by passing the -o
                    option along with --bind/--rbind.
      --
      I hereby place the above post in the public domain.
    101. Re:Ummm.. by Dadoo · · Score: 1

      if your app "knows nothing of Unix permissions" how does it screw things up?

      Wow, I must have really spaced when I wrote that line. There should have been an "and the application's own access controls leave a lot to be desired" at the end of that sentence.

      I'll give you the full story, if you want, but I have to ask: do you really care? Don't get me wrong, I'd love to have your input, especially if you think you can improve the situation, but we're so far off-topic now, I'm surprised no one's modded us down. We should at least take this discussion elsewhere.

      --
      Sit, Ubuntu, sit. Good dog.
    102. Re:Ummm.. by Hal_Porter · · Score: 1

      Well some of us care about the orphans in Uganda, and some of us just want to edit text I guess.

      Don't get me wrong, I'm firmly in the second camp.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    103. Re:Ummm.. by Hal_Porter · · Score: 1
      I still use mutt on the server I admin.
      It's a tremendously powerful email client, no other comes even close.

      For personal email I use Gmail or Thunderbird, thought.


      In what sense is it powerful? Why do you like it? I looked it up on Wikipedia and found

      http://en.wikipedia.org/wiki/Mutt_(e-mail_client)

      Mutt is a pure Mail User Agent (MUA) and cannot send e-mail in isolation. To do this, it needs to communicate with a Mail Transfer Agent (MTA) using, for example, the common Unix sendmail interface. However smtp support has been added to the unstable branch at version 1.5.15 and will work its way into the stable branch.

      It is rather configurable: it has hundreds of configuration directives and commands. It allows for changing all the key bindings and making keyboard macros for complex actions, as well as the colors and the layout of most of the interface. There are also many patches and extensions available that add functionality, such as NNTP support or a sidebar.

      Mutt is fully controlled with the keyboard, and has support for mail threading, meaning one can easily move around long discussions such as in mailing lists. New messages are composed with an external text editor by default, unlike pine which embeds its own editor known as pico (though you can configure pine to shell out to an external editor).

      Sounds ghastly really. What can it do that Thunderbird can't?
      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    104. Re:Ummm.. by Hal_Porter · · Score: 1

      Do you also want to question why we're still using bourne compatible shells, vi derivatives, or Perl?

      Umm yeah, why are people still using those ;-)

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    105. Re:Ummm.. by doti · · Score: 1

      It's more low-level and command-line oriented, while still having a nice graphical (ncurses) user interface. It can:
      - Open any mailbox from any user on the server (as root, of course) without having to configure an email account;
      - Easily select all emails from a date range with a simple command line (T~d dd/mm/yyyy-dd/mm/yyyy);
      - Open and edit any part of the email, including attachments;
      - Reply, forward or bounce multiple messages at once.

      Also check http://www.mutt.org/#features

      --
      factor 966971: 966971
    106. Re:Ummm.. by Hal_Porter · · Score: 1

      - Easily select all emails from a date range with a simple command line (T~d dd/mm/yyyy-dd/mm/yyyy);

      You can do this in a GUI of course - sort by date, scroll to the start of the range, hold down shift and use the arrow keys or PgUp, PgDn to select.

      - Open and edit any part of the email, including attachments;

      But most of the attachments I get are office documents, and you can't edit those in Mutt. Or pictures, but Thunderbird displays them inline.

      - Reply, forward or bounce multiple messages at once.

      I haven't ever tried this in Thunderbird. I think it will forward them all as attachments in one message though, which is pretty useless. I can see if you're an admin on a server, batch forward, reply and bounce is useful though.

      - Open any mailbox from any user on the server (as root, of course) without having to configure an email account;

      Another admin type thing.

      Ok, I see what you mean. If you're a mail admin then this sort of thing is useful. But for regular users, not so much. But I know people who swear that Mutt, Vi/Emacs and other character mode stuff are more powerful than Thunderbird and UltraEdit for example.

      And it seems to be a European thing too - geeks there tend to use Vi or Emacs, but if you go to Asia everyone seems to use Ultraedit. Which is pretty slick - you can easily use it without taking your hands off the keyboard due to accelerator keys. E.g. the first time you use Find in files you go through the menu, but afterwards you know it's Ctrl+Shift+F and then tab though the dialog fields and use the cursor keys to scroll through the history.

      In Europe I suspect it's a geek credibility thing mostly. That and the fact that since you need to invest an enormous amount of time in learning to use a geek tool without it trashing your work, you become fiercely loyal to it. Much like a battered wife learns becomes loyal to her brutish husband once she learns to avoid provoking him.

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    107. Re:Ummm.. by stonedcat · · Score: 0

      man fsck

      heh

      --
      You can't take the sky from me.
    108. Re:Ummm.. by doti · · Score: 1

      You can do this in a GUI of course - sort by date, scroll to the start of the range, hold down shift and use the arrow keys or PgUp, PgDn to select. Takes more time, and is more error prone, specially with thousands of messages in a mailbox, which is very common at least around here.

      Ok, I see what you mean. If you're a mail admin then this sort of thing is useful. But for regular users, not so much. That's why I said in my original post that I use Mutt on the server, and Gmail/Thunderbird for my personal email.
      --
      factor 966971: 966971
    109. Re:Ummm.. by Doctor+Memory · · Score: 1

      just because there is an option to change atime settings doesn't mean that it is a requirement to do so just to 'use linux on the desktop' The OP's claim was that knowing mount arcana was one of the first things that needed to be known to use Linux. Personally, I've used various distros over the last ten years and mount options were one of the few things I didn't have to mess with. My point was that claiming that you had to know serious low-level details in order to use Linux will put people off from trying it. I personally know several people who gave Linux a try several years ago, but were turned off by the amount of configuration that needed to be done. It's still got the aura of a hobbyist system, and comments like that just perpetuate that impression.
      --
      Just junk food for thought...
    110. Re:Ummm.. by Doctor+Memory · · Score: 1

      Linux is not an operating system. Ever googled for information? Ever xerox a flyer? Ever blown your nose on a kleenex? Drink a coke? Face it, "Linux" has become the common collective noun (or "genericized trademark", if you like) for any and all distros. Tell your average office worker that you don't use Windows, you use Gentoo and collect a blank stare. Tell them you use Linux and you'll be more likely to get a "oh, one of those computer geeks" look. Point being, people have heard of Linux, but aren't too likely to be able to identify individual distros. Like it or not, that's the way the world sees it, if you want to change things you'll need to get a new term out there to replace it. And it'll have to be snappier than "Debian GNU/X.org/Linux".

      Personally, I'd be much more willing to use the term "GNU/Linux" if the GNU software was actually shipped with some other kernel, so there'd be a need to differentiate between GNU/Linux and GNU/BSD or GNU/HP-UX. And don't even bother throwing GNU/Hurd out there, the window closed on that project long ago...
      --
      Just junk food for thought...
    111. Re:Ummm.. by Anonymous Coward · · Score: 0

      Of course, I have to question why [cars] are still using something as ancient as the [wheel].

    112. Re:Ummm.. by orasio · · Score: 1

      Linux is not an operating system. Ever googled for information? Ever xerox a flyer? Ever blown your nose on a kleenex? Drink a coke? Face it, "Linux" has become the common collective noun (or "genericized trademark", if you like) for any and all distros. Tell your average office worker that you don't use Windows, you use Gentoo and collect a blank stare. Tell them you use Linux and you'll be more likely to get a "oh, one of those computer geeks" look. Point being, people have heard of Linux, but aren't too likely to be able to identify individual distros. Like it or not, that's the way the world sees it, if you want to change things you'll need to get a new term out there to replace it. And it'll have to be snappier than "Debian GNU/X.org/Linux".

      Personally, I'd be much more willing to use the term "GNU/Linux" if the GNU software was actually shipped with some other kernel, so there'd be a need to differentiate between GNU/Linux and GNU/BSD or GNU/HP-UX. And don't even bother throwing GNU/Hurd out there, the window closed on that project long ago... Well, I haven't ever done any of those things, mainly because I have never lived in English speaking countries. But of course, I get your point.
      The issue is that we are in a technology forum, where most of us should know better, and in the context of a story about the kernel, when someone says something about Linux, it should not be assumed he doesn't know the difference, and that the less specific meaning is the right one.

      There is a context to every conversation. I think in _this_ context, "Linux" means Linux. Of course, I agree with you, in the streets, and when talking to people who don't know or care about that, it's easier to use words for what they have been already marketed to mean.

      Aside from that, when people ask me about my laptop software (mostly because of the Beryl desktop), I don't tell people I use Linux, I say it's Ubuntu, and most of them already know what it is.
    113. Re:Ummm.. by dougmc · · Score: 1

      Sounds ghastly really. What can it do that Thunderbird can't? Run without a GUI.


      Don't go criticizing things you've never even used before just based on their Wikipedia page.

  3. Probably overblown by jimicus · · Score: 4, Insightful

    Seriously. Many have recommended mounting filesystems with the "noatime" parameter if you don't need to know atime for many years now,

    1. Re:Probably overblown by Anonymous Coward · · Score: 0, Insightful

      If atime isn't so hot, and everything works better without it, then it sounds like it's time for the kernel developers to discuss turning it off by default and letting people turn it on if they need to know the atime.

    2. Re:Probably overblown by DrSkwid · · Score: 1

      What do the kernel developers have to do with how the disks are configured by default in a distribution ?

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    3. Re:Probably overblown by tepples · · Score: 3, Informative

      If atime isn't so hot, and everything works better without it, then it sounds like it's time for the kernel developers to discuss turning it off by default and letting people turn it on if they need to know the atime. Isn't that the distro's job?
    4. Re:Probably overblown by Vellmont · · Score: 2, Insightful


      Seriously. Many have recommended mounting filesystems with the "noatime" parameter if you don't need to know atime for many years now,

      Except for the fact that there are programs that rely on atime, so distributions don't want to set the default mount option on a filesystems to noatime.

      For the vast majority of users who aren't interested in screwing around with their filesystem (and don't even know what a filesystem IS), that means that they'll suffer this performance penalty. That's why this middle ground option is attractive.

      Try to remember that Linux is used by countless people that have no interest, or no ability to tweak their operating system.

      --
      AccountKiller
    5. Re:Probably overblown by Yokaze · · Score: 4, Interesting
      No, it is not overblown, because, as Alan Cox put it:

      Ext3 currently is a standards compliant file system. Turn off atime and its very non standards
      compliant, turn to relatime and its not standards compliant but nobody will break (which is good)

      It is no option for the kernel to make noatime standard, as it would brake POSIX compliance. But without noatime, the OS suffers a large penalty compared to some other OSs. The magnitude of the penalty has been made clear in the quote from the article.
      So a solution, which is POSIX compliant, but doesn't suffer as much a penalty as the current solution is sought for.
      --
      "Between strong and weak, between rich and poor [...], it is freedom which oppresses and the law which sets free"
    6. Re:Probably overblown by TheRaven64 · · Score: 1

      For filesystems like /tmp, and /usr (maybe /var if it gets a lot of read traffic), noatime is probably a good idea. For the last few years, however, most Linux distributions have discouraged having multiple partitions, making it much harder to do this kind of tuning.

      --
      I am TheRaven on Soylent News
    7. Re:Probably overblown by mce · · Score: 1

      It's not up to kernel developers to do this. I'm more than capable of compiling my own custom kernel, but I do not want to do that everytime I install a machine or upgrade a kernel in order to overrule some other guy's personal preference. I don't have the time for that (anymore). It's up to the distribution builders to make a default decision regarding atime and to do it in such a way as to allow their customers to overrule it with minimal effort by (not) specifying a mount option. In other words: everything works just fine as-is and nothing at all needs to be changed.

    8. Re:Probably overblown by Rob+Simpson · · Score: 2, Insightful

      Or the more user-friendly distros could just pose a simple question in plain english, like in ArcherB's post:

      "Do you wish to log whenever a file is written or read? So every time a file is used, it has to write an entry on the HDD, slowing performance, but it can have uses, like in forensics, security or backups (if a file has not been read in three years, it's probably safe to archive and move off the drive)."

      With the default answer being "no" and only a single click required to make it "yes".

    9. Re:Probably overblown by Maltheus · · Score: 3, Interesting

      For the last few years, however, most Linux distributions have discouraged having multiple partitions

      Really? I can't see why. In the past, I didn't really see the point of multiple partitions but with the choice of filesystems now, they make a huge difference. Putting my /usr/portage (Gentoo) dir in a separate ReiserFS partition makes system updates a lot faster. And dealing with large video files on anything less than XFS is a slow PITA, especially when trying to delete the associated transcoding temp files. Maybe these things don't affect the average user much, but computers are never fast enough for me and I'll take what I can get.

    10. Re:Probably overblown by dubbreak · · Score: 1

      Try to remember that Linux is used by a finite countable group of people that have no interest, or no ability to tweak their operating system.

      There, fixed that for you.

      Maybe my perspective is skewed, but I'd wager the amount of people who actively use linux (directly not via interacting with websites hosted on linux or what have you) that can not or have no interest in tweaking their OS would at best populate a small town.

      Of course 99% of the people I know that use linux actively are ubergeeks or do so for a living and must know how to tweak it..
      --
      "If you are going through hell, keep going." - Winston Churchill
    11. Re:Probably overblown by Fred_A · · Score: 1

      Not having /home on a separate partition makes clean backups / updates / distro switches way more complicated than they ought to be. On a small workstation I regularly toss the rest together but /home is always by itself.

      --

      May contain traces of nut.
      Made from the freshest electrons.
    12. Re:Probably overblown by Fred+Ferrigno · · Score: 4, Insightful

      That's a really silly question to ask the user at install. If you had to answer all questions of that level of significance, it would take forever. ("Do you want version 0.8.5 of this library or 0.9.1? 0.9.1 has more features but is less compatible...") Let the distro pick a sensible default and have users who know or care about it change it later for themselves.

      The only real question is whether noatime or relatime make for a more sensible default.

    13. Re:Probably overblown by grahamd0 · · Score: 0, Flamebait

      Try to remember that Linux is used by countless people that have no interest, or no ability to tweak their operating system.

      No, no, no. You're thinking of Windows.

    14. Re:Probably overblown by Vellmont · · Score: 1


      Or the more user-friendly distros

      You consider a complex question of whether you want to break unknown pieces of software, or have better performance at install time to be "user friendly"? I've used Linux for 13 years, and I can't even really answer that question. How the hell am I supposed to know which software (like mutt) uses atime, and which doesn't? And then, when that critical piece of software doesn't work, how am I supposed to trace it back to that decision I made a year or two ago?

      Asking this kind of question that has the potential to break software is foolish at best.

      --
      AccountKiller
    15. Re:Probably overblown by RzUpAnmsCwrds · · Score: 1

      Really? I can't see why. In the past, I didn't really see the point of multiple partitions but with the choice of filesystems now, they make a huge difference. Putting my /usr/portage (Gentoo) dir in a separate ReiserFS partition makes system updates a lot faster. And dealing with large video files on anything less than XFS is a slow PITA, especially when trying to delete the associated transcoding temp files. Maybe these things don't affect the average user much, but computers are never fast enough for me and I'll take what I can get.


      Are you trying to sound like a Gentoo ricer?
    16. Re:Probably overblown by Anonymous Coward · · Score: 0

      and let me guess the -O2007 optimization flag makes xterm launch that much faster?

    17. Re:Probably overblown by rikkus-x · · Score: 1

      Which programs rely on atime?

    18. Re:Probably overblown by jimicus · · Score: 1

      News to me. In the recent past, I've used CentOS, Fedora Core, Ubuntu, Debian and Gentoo and every one of them has suggested separate partitions. Fedora, CentOS and Ubuntu make this particularly easy by using LVM, Debian offers LVM as an option and Gentoo... well, Gentoo is just Gentoo.

    19. Re:Probably overblown by bensch128 · · Score: 1

      wow that's really interesting. Do you have a link to point out the best FS for the task required?

      ben

    20. Re:Probably overblown by jjmaestro · · Score: 1

      Hi, I am not the parent but in case you find it useful...

      Here are two links from a cool, smart (and gorgeous :D) kernel hacker, Val Henson:

            http://infohost.nmt.edu/~val/review/choosing.pdf
            Choosing and tuning Linux file systems

            http://infohost.nmt.edu/~val/fs_slides.pdf
            A (very) brief history of UNIX file systems for the average computer layperson. Includes the super cool file system feature chart showing which file systems have which features.

      Cheers,

      --
      J. Javier Maestro
    21. Re:Probably overblown by drew · · Score: 1

      You consider that to be plain English? I can barely imagine my wife (who is fairly computer literate, and uses linux on our laptop) trying to figure out what that means. Just about everyone else that I know that doesn't write software for a living would be totally lost at that prompt.

      --
      If I don't put anything here, will anyone recognize me anymore?
    22. Re:Probably overblown by Maltheus · · Score: 1

      I'm not crazy with optimizations and I don't even know the one you mentioned. I use vanilla cflags too. But the file system thing does make a big difference. I know this because I haven't done this with all my computers and I'm constantly transcoding video on them all. It can take me a couple of minutes to delete my temp files from an ext3 system, but it's instantaneous under XFS. And "emerge --sync" is so much quicker on a ReiserFS that emerge is now even telling me to using it when I'm not because it can detect how slow it's running. All of this adds up. I don't care about microseconds, I'm talking minutes.

    23. Re:Probably overblown by Maltheus · · Score: 1

      Someone else provided a couple of links for you, but the two file systems that stand out are ReiserFS for lots of small files (compiling source code, maybe /var, etc) and XFS for the large ones (video, ISOs, tarred backups, etc). However it's recommended that you use an uninterruptible power supply with XFS as a power outtage while writing may zero out the file. I generally use ext3 for all the rest and ext2 for the /boot partition, for no particular reason.

    24. Re:Probably overblown by Maltheus · · Score: 1

      Nah, the only reason I even mentioned Gentoo is that an 'emerge --sync' shows the greatest benefit from ReiserFS that I've seen. I don't even use specialized cflags anymore aside from the ones everyone uses (-O2 -pipe -fomit-frame-pointer). I prefer Gentoo more for the community support, rather than the possible optimizations.

    25. Re:Probably overblown by bensch128 · · Score: 1

      cool!!
      thanks, now I can finally choose the best FSs for my next system.
      Oh wait, I'm getting lazier, ok I'll just use ext3 for everything...

      ben

    26. Re:Probably overblown by Rob+Simpson · · Score: 1

      It's more at the level of choosing between ext3 and xfs, which are options - but not when the most basic install is chosen.

  4. there was no "noatime" option before? by jandrese · · Score: 1, Insightful

    In the various BSD flavors you can mount volumes "noatime", which is generally safe and does a pretty good job of keeping things moving. If you really need atime updates you can always remount the volume, but frankly not many people use it from what I've seen (maybe tail -f?).

    --

    I read the internet for the articles.
    1. Re:there was no "noatime" option before? by PalmKiller · · Score: 2, Informative

      Yes its there...I use noatime on many linux servers. Most definetly use it where news and maildir type mail folders are mounted.

      For instance on the mail server do this in the fstab (not necessary on root and the like...just use it on the heavy traffic mounts): /dev/sda2 /var/spool ext3 noatime 1 2 /dev/sdb1 /home ext3 noatime,usrquota 1 2

    2. Re:there was no "noatime" option before? by larry+bagina · · Score: 2, Informative

      if the file is appended, the ctime will be updated. the BSD tail checks for an inode change or a decrease in filesize (and reopens in that case). Otherwise, the file descriptor is kept open and continually read from. When new data is written to the file, it will be available for reading automatically.

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    3. Re:there was no "noatime" option before? by larry+bagina · · Score: 1

      s/ctime/mtime/

      --
      Do you even lift?

      These aren't the 'roids you're looking for.

    4. Re:there was no "noatime" option before? by DrXym · · Score: 2, Interesting
      In the various BSD flavors you can mount volumes "noatime", which is generally safe and does a pretty good job of keeping things moving. If you really need atime updates you can always remount the volume, but frankly not many people use it from what I've seen (maybe tail -f?).

      I wish Unix (including Linux) would be more proactive about culling options which are not used by the majority and have such a detrimental effect. If the disk performance leaps by 10% by not using atime, it seems a no-brainer that noatime should be the default. If some app uses atime, it should be fixed or deprecated. There is no real excuse for dragging the whole system's performance for the sake of some crummy mail app.

    5. Re:there was no "noatime" option before? by mr_mischief · · Score: 1

      tail -f would only need to seek to the end of the file periodically and see if there's anything to read. In fact, some implementations close the file, re-open it, then seek to the end of the file. That allows other programs to actually write to the file that's being tailed even if there's an implicit lock (like on Windows).

      GNU tail does some nice things like detecting if the inode has changed and opening the new file in place of the old one. That helps with some things like log rotation during the tail. I also saw just now some mtime, device, mode, and filesize checks, but nothing to do with atime.

  5. mount noatime? by twitter · · Score: 1, Redundant

    man mount says:

    noatime

    Do not update inode access times on this file system (e.g, for faster access on the news spool to speed up news servers).

    Is there something I'm missing?

    --

    Friends don't help friends install M$ junk.

    1. Re:mount noatime? by bugnuts · · Score: 3, Informative

      Is there something I'm missing? Nope, it's something everyone else has been missing and apparently what's obvious to sysadmins is not obvious to the world. I do like the relatime option, though.

      atime updates actually help a LOT in some circumstances. I use it to help with security checks (even though you can hack the atime record), to help debug (what input file caused it to hang?), and all sorts of things where it's useful to know when a file was read.

      I could cope with not having them, but in many cases I love the extra information atime gives.
    2. Re:mount noatime? by Anonymous Coward · · Score: 0

      With atime, you has to read 4096 bytes and write 4096 bytes of one block to write only one 64-byte inode because of the guiltyness of the atime feature!!!

      That useless is the Unix's atime feature!!!

      And remove the Unix's atime feature, please!

      "access time" is .... i dude ... WHO ACCESS TO THE FILE? A UNKNOWN ENTITY HAS ACCESSED TO THIS FILE IN DATE blablabla ... and the unknown was the "integrity checker daemon".

      If the "integrity checker daemon" touch the access time to ALL the files then the daemon is continously updating and writing the access time of ALL the files!!!

      The administrator sees no reason why all the files are accessed lastly.

  6. Ok, I'm missing something here by Marxist+Hacker+42 · · Score: 2, Insightful

    And, for every file that is already cached and which we read from the cache ... do a write to the disk!'

    Uh, why? Or rather, why not cache the atime update until disk usage is clear, THEN do the write, at least for already cached files?

    --
    SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
    1. Re:Ok, I'm missing something here by Anonymous Coward · · Score: 0

      Or write it out at intervals, upon a sync(), etc.

    2. Re:Ok, I'm missing something here by Graff · · Score: 1

      Exactly what I was thinking, wouldn't it be smart if all of the access times were just cached and then updated in one write? I mean why do 100 small writes when you are in the middle of a bunch of reads when you can just gather up all the access times and write them in a burst.

      It just seems like common sense to me. Yes, access times can be useful data but I think they are minor enough not to be done immediately. I'd default to having them cached and have an option for them to be applied immediately for those people who want that.

    3. Re:Ok, I'm missing something here by EvanED · · Score: 1

      That was my reaction too.

      In fact, I'm tremendously surprised that it doesn't do this already.

      Can anyone who knows more about the kernel comment? *Does* it do them batched, and it's still a performance drain? If not, is there a reason that they aren't?

    4. Re:Ok, I'm missing something here by SmackedFly · · Score: 1

      Because if you do that, you can't trust the access times in case of a crash. Furthermore, since the access times are a property of the seperate files, your harddrive will still have to write multiple places. One solution to the problem, might be to write the atimes to the journal, and then just update it once in a while, or perhaps even link the atimes to some seperate part of the disk, so the atimes can be written in one go somehow. But caching the atimes in memory is a recipe for disaster and inconsistency!

    5. Re:Ok, I'm missing something here by Graff · · Score: 1

      Yeah I was reading further about it and I believe another big problem is that when the atime is updated it marks the whole inode as dirty. You can keep the inode in memory but you'll then start to accumulate a large store of dirty inodes or you can write it out immediately and get the performance hit.

      I don't think trusting the access times is too critical in most cases, the cases where it really seems to matter are in software that checks for the files that have the most activity or programs that monitor for new files. For those programs the access time provides a simple way of doing their job but there are only a few programs that need this information. It seems like it would be easier to have a separate file which keeps track of the last so many accesses and then write that file out when the disk activity allows for it. If you really want each inode to have the access time stored within it then maybe have a process that uses idle time to apply the access times to the proper inodes.

      What I'm getting at is that due to the structure of most file systems it doesn't make sense to update access times immediately and spread across the storage device. Instead you can keep the access time information somewhere centralized and pick a proper idle time to apply the information to the inodes. Any program that needs to monitor for most recent accesses can then just check the file which temporarily stores the most recent access times. I think that's basically similar to what you were saying in your post.

    6. Re:Ok, I'm missing something here by dgatwood · · Score: 1

      It's far better than completely throwing away the semantics of atime to only log the time of the first read after the file is written. In effect, instead of making it so that the atime is useless after a crash, the relatime proposal makes it useless at all times.

      Besides, you can't count on it for files modified shortly before a crash anyway. Anything that was dirty in a cache could be stamped wrong. The only thing this does is extend the period of vulnerability, and IMHO, this is the piece of information that is least relevant, so extending the period of vulnerability on atime is not a great loss. I'd much rather it be correct in core where it doesn't affect behavior during normal circumstances but might get lost in a crash than have it nearly go away entirely (which the relatime patch comes very close to doing). If having guaranteed reliability of atimes even in cases of crash is a requirement, you'd better have the filesystem mounted synchronously, in which case the whole issue is moot, as the atime change will be written immediately.

      As for the suggestion to cache it like that, I was about to propose the same thing. I'd go one step farther, though.

      My suggestion is to maintain atime in core and not flush inodes if only the atime changed unless the inode is forced out of core due to memory pressure or the disk is completely idle, and don't do an idle flush unless the atime is at least three minutes in the past. For most loads and configurations, the disk should go idle and allow the altered atime to be written out without substantial penalty long before you hit memory pressure. The combination of those criteria would also effectively act to coalesce multiple atime changes, since accesses to a file are often clustered in time.

      Of course, for most sane loads, I would expect atime writes to disappear into the noise anyway, so I'm a little baffled as to what all the fuss is about.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    7. Re:Ok, I'm missing something here by Anonymous Coward · · Score: 0

      Because that wouldn't be posix compliant behavior.

      A 'noatime' option to explicitly tell the system to be non-standard and leave the default behavior exactly as it is right now is the best approach.

    8. Re:Ok, I'm missing something here by amRadioHed · · Score: 1

      ...to only log the time of the first read after the file is written. That's not what they are doing, they are only logging the time of the first read each day after the file is written.

      No it's still not perfect, but it doesn't make atime useless since it preserves atimes ability to show if a file is still being used by anything.
      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
    9. Re:Ok, I'm missing something here by Marxist+Hacker+42 · · Score: 1

      I wasn't aware that posix-compliant restricted actual improvements in accuracy.

      --
      SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
  7. Linus did not say that! by JbirdUAH · · Score: 5, Informative

    if the poster had read the article they would have noticed that Linus did not say those things that are quoted - Ingo Molnar did.

    1. Re:Linus did not say that! by Anonymous Coward · · Score: 5, Funny

      My name is Ingo Molnar and you mis-attributed my quote. Prepare to die!

  8. Citation error by Anonymous Coward · · Score: 1, Funny

    Spot the citation/reference error!

  9. atime vs ctime by Intron · · Score: 5, Insightful

    Amazingly, standard Unix filesystems keep time of last access (atime), change of status (ctime), and file modification (mtime) but do not remember when the file was first created, which is something I have frequently wished for.

    --
    Intron: the portion of DNA which expresses nothing useful.
    1. Re:atime vs ctime by Anonymous Coward · · Score: 0

      That's because files are not "created", they are merely called forth from the aether.

    2. Re:atime vs ctime by Anonymous Coward · · Score: 0

      Guess Unix creators didn't buy intellegent design either...

    3. Re:atime vs ctime by clem · · Score: 2, Interesting

      Well, add enough features and a filesystem begins to look like a source control system. I don't see any advantage by having file creation times tracked by the kernel -- better to do it in user space.

      --
      Your courageous and selfless spelling corrections have made me a better person.
    4. Re:atime vs ctime by Xtravar · · Score: 1

      Indeed. What more is a file than a sectioning off of disk space?

      But really, Create Time would be nice... even if they call it Summoning Time or Ethereal Conjuring Time.

      --
      Buckle your ROFL belt, we're in for some LOLs.
    5. Re:atime vs ctime by EvanED · · Score: 1

      Well, add enough features and a filesystem begins to look like a source control system. I don't see any advantage by having file creation times tracked by the kernel -- better to do it in user space.

      Um, you mean besides the fact that any program can make a file and that info will be available? Heck, why not put the ctime and mtime in userspace as well?

      (Disclaimer: I wouldn't complain one bit if a filesystem behaved as a source control system. I already want versioning.)

    6. Re:atime vs ctime by EvanED · · Score: 5, Interesting

      There is a technical reason for this.

      A lot of the time, modification of a file... isn't a modification of a file. Instead, the program will delete the existing file and create a new one in its place. (There is sometimes other operations in there, like saving to a temp file, deleting the original, then renaming the temp file to the original file name.)

      This means that storing the real creation time of a file means that it won't be what you expect, because the file that you think is the same file actually isn't.

      (MS-DOS/Windows have something called filesystem tunneling to attempt to get around this problem. If a file is deleted and a new one created in its place (see the MSDN article linked to from there for details) within a default 15 seconds, the creation time of the old file is carried over. This technique exchanges purity and absolute correctness (not that metadata times are reliable against tamper anyway) for utility.)

    7. Re:atime vs ctime by EvanED · · Score: 5, Interesting

      I know self-replies are stupid, but I should have mentioned something else. The metadata tunneling that Windows does is much more important than it is on Unix because the filename may need to be tunneled as well. If you open a file called "somefile with a long name.txt" in an old DOS program by opening SOMEFI~1.TXT (or even in a recent program) and it does this delete/create thing, you don't want the OS to say "oh, you're making a new file called SOMEFI~1.TXT. Spiffy"; you need the original "somefile with a long name.txt" name to carry over.

      The linked site explains all this, but I know the propensity of /. readers (myself included) to RTFA. ;-)

    8. Re:atime vs ctime by Crispy+Critters · · Score: 1
      "but do not remember when the file was first created,"

      Nice idea, but pretty clearly problematic in reality.

      Example: Open something.txt in emacs, make a change, and save it. The old file something.txt is renamed something.txt~ and the modified version is saved as something.txt. So, when was something.txt first created? Just now. Not very useful.

      If you rename a file, does the "first created" time change? How about if you truncate it to zero length and write completely new information? What if you do both? The whole concept of "first created" is kind of murky unless files are only appended to.

      When I really, really need to remember when a file was first created, I put the date in the filename.

    9. Re:atime vs ctime by tknd · · Score: 1

      add enough features and a filesystem begins to look like a source control system

      That argument has no weight. See ZFS.

    10. Re:atime vs ctime by Anonymous Coward · · Score: 0

      A lot of the time, modification of a file... isn't a modification of a file. Instead, the program will delete the existing file and create a new one in its place.
      But if Unix had always tracked creation times, then (well-written) programs simply wouldn't behave this way. That's an argument for not introducing creation times now, but it doesn't explain why it was never done that way to being with.
    11. Re:atime vs ctime by EvanED · · Score: 1

      While there are issues (see my earlier post in the thread for a discussion of how Windows does it, which I think is pretty reasonable), I think in all of these cases:

      If you rename a file, does the "first created" time change? How about if you truncate it to zero length and write completely new information? What if you do both? The whole concept of "first created" is kind of murky unless files are only appended to. ...the answer is a pretty clear "the creation time stays the same". There are other, harder, questions, like what happens if you download a file, or email to someone? Should the creation time remain unchanged, or be when it arrived at your computer? What happens if you hand things across on a USB key?

      If you want the time for the CONTENT, that obviously can't really be done by the file system. But oftentimes the existence of a particular file itself means something -- this is why truncation and refilling shouldn't affect the creation time.

      The point isn't that it's as useful as mtime or ctime (though I will assert that done reasonably it'd be more useful than having both of those) or that it would be a fool-proof mechanism for determining the creation time of a file (or ever that such a notion has a universal definition), just that knowing some idea of a creation time would often be very useful (the OP's not the only person who's wished that Unix kept that information), and getting it right most of the time would be a lot better than saying "we can't do it completely right, so let's not do it it at all."

    12. Re:atime vs ctime by EvanED · · Score: 1

      This argument has some merit, but at the same time, there are very good reasons why the current approach is a reasonable way to do things. The biggest is that it gives an appearance of something closer to a transaction. If your program goes through and overwrites data and dies halfway through, the file is probably going to be in a nonsense state.

      However, say you write out the new information to a new file, delete the old file, and rename. If you die halfway through writing out the new file, the old file still lives. There are really only two inconsistent states that it could be in: the program dies before deleting the old file, in which case there is an extra file in the filesystem (which is possibly incomplete); and the program dies after deleting the old file but before renaming the new one to the old name, in which case the new file will be fully-written (let's ignore disk syncing), just have the wrong name.

    13. Re:atime vs ctime by clem · · Score: 1

      True, any program would have the file's creation time available. Can you provide a use case of how this would be genuinely useful -- a use case not already solved by mtime and ctime? Not trying to be snarky, but I don't see how this is anything other than a solution looking for a problem.

      --
      Your courageous and selfless spelling corrections have made me a better person.
    14. Re:atime vs ctime by MavEtJu · · Score: 1

      FreeBSD has this:

      STAT(2)                   FreeBSD System Calls Manual                  STAT(2)
      [...]
           The time-related fields of struct stat are as follows:
      [...]
           st_birthtime  Time when the inode was created.

      --
      bash$ :(){ :|:&};:
    15. Re:atime vs ctime by QuoteMstr · · Score: 1

      It's better than that, at least for posix. rename(2) is atomic and overwrites an existing file, so there's really no window between deleting the old file and replacing it with the new one.

    16. Re:atime vs ctime by doug · · Score: 1

      But really, Create Time would be nice... even if they call it Summoning Time or Ethereal Conjuring Time. I agree that there are times when it would really be nice to know how long a file has existed, but it is pretty much impossible to implement without better AI, or user space giving the kernel extra info.

      Imagine something simple like

            sort foo >bar
            mv bar foo

      I bet you want the second foo to have the same ECtime as the first. Well, to the file system, those are two different files that happen to have the same filename. And even if you did something like

          munge_file foo

      The binding between input inode and output inode is done in user space. Even if the kernel figured that out and preserved (copied, really) the ECtime, then the times that you wanted a new ECtime, it would be wrong. Something dumb like

          echo $something >foo

      might imply that you want a new ECtime because you are intentionally clobbering foo.

      The only way I can think of to get this to work is to have your application read() file foo, rewind() to the beginning, and overwrite the file in place. Most applications don't do that today, the simply read() into memory, and later write over the file (not append). Obviously log files are an append only special case, and that class of file could preserve this ECtime info.

      - doug

      PS: This reminds me of ClearCase evil twins. Ungh.
    17. Re:atime vs ctime by slittle · · Score: 1

      Instead, the program will delete the existing file and create a new one in its place.
      This is evil and anyone doing it should be KILLed on the spot, for the simple reason that removing and recreating a file destroys its permissions and requires the user to have write permission to the parent directory instead.

      This means that storing the real creation time of a file means that it won't be what you expect, because the file that you think is the same file actually isn't.
      Depends what you consider a "file" doesn't it? ;) A file, to me, is an entity on the disk; a record in the filesystem, independent of its content. A creation time should change for any copies made from it, or if moved to another filesystem.

      What you're talking about is content creation time, not file (meta) creation time. Since UNIX already has mtime and ctime to record the content modification and meta modification, why not also content creation and meta creation?

      Fortunately, noatime turns the atime into a meta creation time, so that'll do me just fine.
      --
      Opportunity knocks. Karma hunts you down.
    18. Re:atime vs ctime by amRadioHed · · Score: 1

      My files are intelligently designed.

      --
      We hope your rules and wisdom choke you / Now we are one in everlasting peace
    19. Re:atime vs ctime by Anonymous Coward · · Score: 0

      The way this traditionally works on the Mac is as follows:
      1) write the new data into a temporary file
      2) swap the data streams of the new and old file
      3) delete the temporary file, which now references the old data.

      The original file's inode, with all its metadata, remains unaffected. This way you can have a safe-save technique while preserving creation date (and all the other attributes), without having to use any weird hacks like in Windows.
      The system call to swap the data of two files is still available in OS X, although people coming from a Windows or Unix background probably don't know it.

    20. Re:atime vs ctime by EvanED · · Score: 1

      This is evil and anyone doing it should be KILLed on the spot, for the simple reason that removing and recreating a file destroys its permissions and requires the user to have write permission to the parent directory instead.

      This is a good point. I was curious how things interacted with that, so I tried it. (The place where I got most of that information, which I linked to, is a Windows-centric source; if you go back to the DOS days, there were no permissions or whatnot to worry about. I knew that Unix programs also traditionally do something non-intuitive, so I assumed it was the same thing.)

      I did an strace on vi as I saved a file. It does indeed appear to do what I said. It unlinks "temp.txt", renames it to "temp.txt~", then opens "temp.txt" again with O_CREAT (&O_TRUNC and OWR_ONLY). It does a few stats (of both files, at lots of times) and also a chmod of "temp.txt" -- presumably to fix that issue. I'm curious whether it would preserve extended attributes -- from this, I strongly suspect not -- but apparently the fairly old version of Knoppix I've booted doesn't have it enabled in the kernel (and my Linux installation is somewhat shot).

      I chmod'd the directory so that I didn't have write access, and the behavior changed. The call to rename now returned EACCES (permission denied). It tried to open "testfile~" for writing, and that also returned EACCES. It tries a few other things (I don't exactly follow), but eventually it tries unlinking "testfile" again, which errors, so then it finally opens it with O_WRONLY and O_TRUNC (&O_CREAT), and that succeeds. It writes out the file's contents.

      For one final test, I created a "testfile~" file before saving. In this case, it successfully opens testfile~ for writing and outputs the old old to it.

    21. Re:atime vs ctime by EvanED · · Score: 1

      ...then it finally opens it with O_WRONLY and O_TRUNC (&O_CREAT), and that succeeds

      Just in case it's not clear from that description, I'm pretty sure that's probably the same open call each time. Just in the first case, the O_CREAT flag comes into play because the preceding unlink succeeded and there is no file with that name, and in the second case, the O_TRUNC flag comes into play. In both cases, there's an empty file it writes into.

    22. Re:atime vs ctime by Electrum · · Score: 1

      [delete the existing file and create a new one in its place] is evil and anyone doing it should be KILLed on the spot

      This is necessary due to filesystems lacking a transactional API. Suppose you edit a file and insert a line at the top. Your editor has a few choices when saving:

      1) Open the existing file for write and rewrite the whole thing.

      2) Make a backup of the existing file. Perform #1. Optionally delete the backup.

      3) Create a new file, write the whole thing, then rename.

      Option #1 has the advantage of preserving metadata, but risks corrupting the original if the machine crashes or loses power, disk fills up, etc.

      Option #2 doubles the amount of disk I/O and storage required.

    23. Re:atime vs ctime by Intron · · Score: 1

      I think I just want the time that get_inode was called.

      The cases that you list are already covered in Linux by the touch command.

      sort foo >bar
      touch bar -r=foo
      mv bar foo

      touch -r uses the times from the reference file foo.
      mv changes the name or directory but shouldn't affect the time.

      --
      Intron: the portion of DNA which expresses nothing useful.
    24. Re:atime vs ctime by Intron · · Score: 1

      Quite a few filesystems store creation time, just not standard Unix.

      http://en.wikipedia.org/wiki/Comparison_of_file_sy stems#Metadata

      --
      Intron: the portion of DNA which expresses nothing useful.
    25. Re:atime vs ctime by Anonymous Coward · · Score: 0

      That's a good point - filesystems really *should* have a transactional API. Nowadays, Windows does (http://msdn.microsoft.com/msdnmag/issues/07/07/NT FS/default.aspx) and Linux should follow suit.

    26. Re:atime vs ctime by EvanED · · Score: 1

      Okay, further experimentation reveals some more data.

      I created a file, attached an extended attribute to it with setfattr, then modified it in several different programs. Vi and Emacs, when they save, both destroy the extended attribute. (I didn't strace anything but vi, but I assume it's because of the same reason -- vi does actually delete the original file and recreate it.) The shell (when using >> redirection), Nano, Kwrite, and Kate all do not destroy the extended attributes. (Nano seem to do anything unusual. It does truncate the file and write it out again though. I didn't strace the others.)

    27. Re:atime vs ctime by slittle · · Score: 1

      You know, if you had a meta creation field on your files, you'd know if it was deleted and recreated or truncated and copied over, without all this testing ;)

      --
      Opportunity knocks. Karma hunts you down.
  10. Summary please? by alta · · Score: 1

    WTF? I think I get it now, but I didn't until I started reading the comments... But how about someone give a synopsis for the non kernal hackers here.

    --
    Do not meddle in the affairs of sysadmins, for they are subtle, and quick to anger.
    1. Re:Summary please? by mpeg4codec · · Score: 5, Informative

      File access timestamps, by default, are updated each time a file is read, and this occurs a write to the disk. Even if a file resides in cache, a write must be performed every time it is opened [even though the cache prevents a read from the disk]. A few people found that by disabling this, performance increases dramatically. The long and short of it: use noatime when you're mounting a file system [or in the fstab] if you want to try for yourself.

  11. doh. by twitter · · Score: 1

    And then I read the article. Very intersting, but the noatime trick will work till they get realtime sorted out. (unless you use mutt)

    --

    Friends don't help friends install M$ junk.

  12. Why not a better "atime" instead of "noatime" by datadigger · · Score: 1

    I see no reason why atime updates can't be postponed until some moment other metadata has to be flushed, or once a minute, whatever comes first.
    The exactness of atime might suffer, but nobody will notice.
    That said, I agree the noatime mount option covers most needs.

    --
    Aphorisms don't fix code. (Bart Smaalders)
    1. Re:Why not a better "atime" instead of "noatime" by Tacvek · · Score: 2, Interesting

      I see no reason why atime updates can't be postponed until some moment other metadata has to be flushed, or once a minute, whatever comes first.
      The exactness of atime might suffer, but nobody will notice.
      That said, I agree the noatime mount option covers most needs. Almost nothing actually uses atime. The Relatime patch therefore only updates atime if mtime or ctime is newer (to show that the file has been accessed since it has been updated or created) or the current atime is over 1 day old. This increases IO usage only slightly compared to noatime, but is less likely to break those few applications that do use atime.
      --
      Stylish sheet to fix many problems in Slashdot's D3: https://gist.github.com/801524
    2. Re:Why not a better "atime" instead of "noatime" by Anonymous Coward · · Score: 0

      Are they really changing the semantics of atime without a way of getting the correct semantics back (except for a kernel patch)? People who access enough files to make it matter probably know about the noatime option, and they probably should be looking for a more efficient way of organizing their data anyway.

    3. Re:Why not a better "atime" instead of "noatime" by Anonymous Coward · · Score: 0

      Congrats for not reading the article jackass. atime isn't going away or being changed.

    4. Re:Why not a better "atime" instead of "noatime" by Anonymous Coward · · Score: 1, Interesting

      You must be new here. Anyway, with sentences like "Getting rid of atime updates would give us more everyday Linux performance than all the pagecache speedups of the past 10 years", the story gives a pretty orthogonal impression to the article (which is not about improvements nearly as big as alluded to in the story, but about improvements to relatime, which is an existing option to avoid the overhead of atime with some of the benefits of atime).

    5. Re:Why not a better "atime" instead of "noatime" by MichaelSmith · · Score: 2, Funny

      Where is Hans Reiser when you need him? This is exactly the type of question he likes to argue about.

    6. Re:Why not a better "atime" instead of "noatime" by Anonymous Coward · · Score: 0

      Jail .... for murder .... I don't think I was to argue with him.

    7. Re:Why not a better "atime" instead of "noatime" by Anonymous Coward · · Score: 0

      Postponing atime updates doesn't really help much, you'll still hit the I/O storm as soon as you need to flush vnodes.

      I usually keep atime enabled, it isn't that bad if you have a decent file system.

  13. Why not just fix the filesystem instead? by vox_soli · · Score: 2, Interesting

    Why should atime updates have to be written out to disk immediately? It probably isn't the end of the world if a few get lost if a filesystem doesn't get unmounted cleanly, and it probably updates a *lot* more frequently than anything else in the inode, so why not just have the filesystem keep the atimes separately from the rest of the metadata somewhere? It would only take a little bit of space to hold all the atimes on most filesystems (4 bytes per atime times say 250,000 files plus 5% for indexing overhead (you'd have to map inode numbers to indices into the array of atimes) is just a little over a megabyte), so if you just set that aside somewhere, cached a copy in memory somewhere, and wrote out updates whenever there was some free bandwidth to the disk, you'd be able to merge updates for many different files together instead of having to write out an entire block for every atime update, that you have to write out immediately because it counts as an inode update and it'd be bad to let those fall out of sync.

    1. Re:Why not just fix the filesystem instead? by McNihil · · Score: 1

      So you exchange a write near the read head by having the atime index someplace else and causing a 2 * ~8 ms seek.... what? NO NO NO not on my machine you are not ;-)

    2. Re:Why not just fix the filesystem instead? by vox_soli · · Score: 1

      atime updates happen when you read the file's content, but not on stat(), so either the head has to move anyway to read the data, and then back to the inode to update it, or your reads have to block until after it gets updated. I really hope they went with the former option. :)

      Anyway, in my proposal you'd be able to merge atime updates for lots of different files together, but you could also keep it in the inode and just have a separate state to say that just the atime is dirty and it's less important to write it out. Now that I'm reading the thread linked to in the article, Arjan van de Ven proposes exactly that and Theodore Tso points out that it would still be POSIX-compliant to lose atime updates if a filesystem gets unmounted uncleanly.

    3. Re:Why not just fix the filesystem instead? by slew · · Score: 2, Informative

      I think lazy-atime already keeps a dirty cache of atimes.

      I think relative-lazy-atime optimizes this further by only scheduling updates for atime if the old atime is older than ctime or mtime. If the old atime is newer than ctime or mtime then it silently forgets if you've accessed the file. If you are updating ctime or mtime, then I think atime is updated anyhow.

      This optimization still allows certain programs to tell if files have been read once since they were last modified (probably the only non-security feature of atime that is in common use), but of course ignores when they are read multiple times.

    4. Re:Why not just fix the filesystem instead? by McNihil · · Score: 1

      Well I would say that file inodes may be closer to file and thus possibly in cache BUT granted that would be an assumption that may not be a good one.

    5. Re:Why not just fix the filesystem instead? by vox_soli · · Score: 1

      It probably isn't really reliable to assume the inode is close to the file, but it probably is in cache >95% of the time because it had to be read during the open(). Anyway, even if the inode is in cache when you read the file you still have to seek to it to write out the atime update the same as if it weren't.

    6. Re:Why not just fix the filesystem instead? by mzs · · Score: 1

      ctime? On Linux? Are you sure you know what you are talking about?

      It is quite straight forward, the relatime patch only updates the access time if the file has been modified since the last time atime was written. This gets around some of the apps breaking otherwise with the noatime mount option. Think about it...

    7. Re:Why not just fix the filesystem instead? by McNihil · · Score: 1

      Personally I would rather want this kind of optimization in the HW layer of the HD. The HD should know when to write or not to optimize speed. With this approach the HD manufacturers can differentiate themselves and its up to the consumer to buy what they need. To place code in the kernel to mimic esoteric HD implementations would be good BUT I will always go with a HW implementation if there is one. Testing environments don't need it but production environments sure do.

      But having said that... the BSD switch to disable atime would be a good approach because ultimately you either care about atime A-LOT or not at all.

    8. Re:Why not just fix the filesystem instead? by vox_soli · · Score: 1

      Um, okay. How is the HD supposed to know about OS-level data structures? An inode looks just like any other block at that level.

    9. Re:Why not just fix the filesystem instead? by McNihil · · Score: 1

      It doesn't need to know anything of the underlying data structures to determine for itself when it is optimal to write to disk or to supply the reader by already cached data. I mean do we handle CPU cache specifically? No it would be very inefficient to do so. Same goes with HD as far as I am concerned. Also by doing it in HW it is far more superior because it is VERY time critical. Not only that but each HD manufacturer would have different approach to optimize how things are interacted with. On the other hand I do come from the SCSI "camp" and have looked at both ATA and SATA with some "disdain" BUT its getting there... slowly.

    10. Re:Why not just fix the filesystem instead? by vox_soli · · Score: 1

      CPU cache happens on time scales around six orders of magnitude faster than anything the disk does; of course it has dedicated hardware. For the same reason it's pretty inflexible about replacement policy.

      The whole point of either of my suggestions is to keep the same POSIX-compatible atime semantics without the overhead of all those disk writes by distinguishing between an inode being written because of an atime update or for some other reason. In the latter case it's probably really important to get it out ahead of other writes so the on-disk filesystem is consistent, but in the former case (which is probably much more common) it isn't a problem if some get lost when a filesystem doesn't get cleanly unmounted, so it can be written out at lower priority than just about everything else.

      The problem of determining priorities for disk writes is inherently an issue for the operating system; it depends on the specific content of the write (inode writes should probably go ahead of data writes, but atime updates should be near the lowesst priority), and the disk controller can't see that and shouldn't try to implement such a system specific feature in hardware anyway. You'd want a completely different scheme if you were going to provide user processes guaranteed bandwidth to the disk, like IRIX does, for example.

      Anyway, the semantic question of determining the relative priorities of disk operations is a separate question from the implementation of that disk scheduling once you know what the priorities are, which probably should be done in hardware (and for all I know probably is).

    11. Re:Why not just fix the filesystem instead? by McNihil · · Score: 1

      Maybe I should read the code in my spare time to see what is actually being done but I doubt that the performance impact is that bad as it is written in ext3. I can see it being a problem BUT again for instance if we have solid state hard drives then the approach would be different again... this is why IMHO the storage makers can sit there and twiddle, optimize their hard drive because THEY know the timings of disk rotation (or whatever lies beneath) and how much they can write and when (maybe I am on a much lower level here and not particularly focused about the atime which at the end of the day feels to me like a fringe optimization... or rather a premature optimization to make it more esoterically implemented.)

      Now I am all for better performing file systems BUT not at the expense of harder to read and understandable code because from a maintenance point of view it isn't viable in the long run... but I digress.

      Having used Irix, Solaris, BSD, HP-UX, Linux in various forms and with their evolving file systems it makes more sense to me going with some form of RAID and get significant performance increase that way... it definitely helps with those 50 GByte compressed log files of mine... on the other hand if I even get the slightest I/O wait states because the OS I am running insists on seek thrashing then I will be violently vocal about it... like the first couple of FFS implementations for the Amiga back in the day. I never saw the implementation code wise for it but I believe the spirit is living on in some weird fashion in the BSD kernel now... and I can understand in that case why switching off atime might be a performance optimization to "recon" with on that platform. Now I can't categorically say that this is the case for all platforms.

      Mountain Dew Moment: one can with a simple excessive use of fflush bring down the mightiest systems if the file system tries to be TOO intelligent on behalf of the user.

      Formed while listening to Rubicon - VNV Nation

    12. Re:Why not just fix the filesystem instead? by Anonymous Coward · · Score: 0

      Seems like NTFS does something similar. Excerpt from http://technet2.microsoft.com/windowsserver/en/lib rary/9fcf44c8-68f4-4204-b403-0282273bc7b31033.mspx ?mfr=true :

      --- BEGIN QUOTE ---
      Using disablelastaccess {1 | 0}

      The disablelastaccess parameter is designed to reduce the logging impact of updating the last access timestamp on folders and directories. Disabling the Last Access Time improves the speed of folder and file access.

      Each file and folder on an NTFS volume contains an attribute called Last Access Time. This attribute defines when the file or folder was last accessed, such as when a user lists folders, adds files to a folder, reads a file, or makes changes to a file. The most up-to-date Last Access Time is stored in memory and is eventually written to the disk in two different locations. One is within the file's attribute, which is part of its MFT record. The second is in the index of the directory that contains the file.

      The Last Access Time on disk is not always current. This lag occurs because NTFS delays writing the Last Access Time to disk when users or programs perform read-only operations on a file or folder, such as listing the folder's contents or reading (but not changing) a file in the folder. If the Last Access Time is kept current on disk for read operations, all read operations become write operations, which impacts NTFS performance.

      Note that file-based queries of Last Access Time are accurate even if all on-disk values are not current. NTFS returns the correct value on queries because the accurate value is stored in memory.

      NTFS typically updates a file's attribute on disk if the current Last Access Time in memory differs by more than an hour from the Last Access Time stored on disk, or when all in-memory references to that file are gone, whichever is more recent. For example, if a file's current Last Access Time is 1:00 P.M., and you read the file at 1:30 P.M., NTFS does not update the Last Access Time. If you read the file again at 2:00 P.M., NTFS updates the Last Access Time in the file's attribute to reflect 2:00 P.M. because the file's attribute shows 1:00 P.M. and the in-memory Last Access Time shows 2:00 P.M.

      NTFS updates the index of the directory that contains the file when NTFS updates the file's Last Access Time and detects that the Last Access Time for the file differs by more than an hour from the Last Access Time stored in the directory's index. This update typically occurs after a program closes the handle used to access a file within the directory. If the user holds the handle open for an extended time, a lag occurs before the change appears in the index entry of the directory.

      Note that one hour is the maximum time that NTFS defers updating the Last Access Time on disk. If NTFS updates other file attributes such as Last Modify Time, and a Last Access Time update is pending, NTFS updates the Last Access Time along with the other updates without additional performance impact.

      Note that using the disablelastaccess parameter can affect programs such as backup and Remote Storage that rely on this feature.

      This parameter updates the HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\N tfsDisableLastAccessUpdate registry key.
      --- END QUOTE ---

      And it looks like it does it well, disabling it on my AMD 1.8 GHz/1GB XP system it gives no noticeable improvement with normal usage. Maybe i should try some "extreme" file operations to see some improvements with "disablelastaccess" set :)
      Anyway... maybe we can learn a thing or two from NTFS...

  14. Maybe it's just about the defaults by Anonymous Coward · · Score: 1, Funny

    I don't see a story here, unless he's suggesting that the default be changed, and even then it's a pretty minor story. Damn, if only he had the source code, he could change it.

  15. Not Realtime As In Real-Time System by RAMMS+EIN · · Score: 1

    Note that this story has nothing to do with real-time systems, contrary to what I thought when I read the title.

    If you read carefully, you will see it says rELAtime, not rEALtime.

    --
    Please correct me if I got my facts wrong.
  16. noatime and rsync by mihalis · · Score: 1

    I found that mounting using the noatime option on Solaris 8 and later was good for performance on filesystems which I mirrored via rsync. For example we had a cvs server that was struggling a little to keep up because rsyncing the files out to the mirrors was expensive. Changing its filesystem options to include noatime meant that a lot of the unnecessary I/O disappeared (previously I guess the very act of checking if a file had changed would have incurred a disk write, and we were syncing every all the files many times an hour). Other operations (e.g. cvs check-in, check-out) would normally operate on a smaller range of files, rsync was the worst case.

  17. You fell victim to one of the classic blunders! by stefanlasiewski · · Score: 5, Funny

    "You fell victim to one of the classic blunders! The most famous is never get involved in a flame war on Kerneltrap..."

    --
    "Can of worms? The can is open... the worms are everywhere."
    1. Re:You fell victim to one of the classic blunders! by dcapel · · Score: 5, Funny

      A Slashdot summary wrong? Inconceivable!

      --
      DYWYPI?
    2. Re:You fell victim to one of the classic blunders! by anilg · · Score: 1

      How dare you be sarcastic? I hate hate hate you! ..with apologies to linus

      --
      http://dilemma.gulecha.org - My philospohical short film.
    3. Re:You fell victim to one of the classic blunders! by darkfish32 · · Score: 1

      I do not think that word means what you think it does.

    4. Re:You fell victim to one of the classic blunders! by emlyncorrin · · Score: 1

      You keep using that word. I do not think it means what you think it means.

    5. Re:You fell victim to one of the classic blunders! by MysteriousPreacher · · Score: 1

      He should have used 'unpossible'.

      --
      -- Using the preview button since 2005
    6. Re:You fell victim to one of the classic blunders! by jez9999 · · Score: 1

      How dare you be sarcastic? I hate hate hate you!

      I can say, without hyperbole, that that is the most ridiculous overuse of sarcasm I've ever seen in my life.

    7. Re:You fell victim to one of the classic blunders! by Dannon · · Score: 1

      No more quoting now, I mean it!

      Anybody want a peanut?

      --
      Good judgment comes from experience.
      Experience comes from bad judgment.
  18. Re:Never!! by heinousjay · · Score: 0, Offtopic

    It should tell you something, noticing that even nerds have no patience for anime.

    --
    Slashdot - where whining about luck is the new way to make the world you want.
  19. if you store them up you could lose them all by Anonymous Coward · · Score: 1, Interesting

    if you lose power you're in trouble because now you have all those pending (how many?) atimes that you just lost. and you don't know how many and for what files so if you rely on atime for something then you suddenly no longer can for any of those files (but which ones? - you have no way of knowing)..

    1. Re:if you store them up you could lose them all by Graff · · Score: 1

      if you lose power you're in trouble because now you have all those pending (how many?) atimes that you just lost. and you don't know how many and for what files so if you rely on atime for something then you suddenly no longer can for any of those files (but which ones? - you have no way of knowing).. Which is why there would be an option for immediately applying the access times. For many people they really don't need to have the access times and having it applied immediately is a huge performance hit. Those people would have the option set to delay the writing of access times, if a crash happens and they lose the access times then it's not a huge deal for them, it's not critical data.

      For the people who rely on access times they could set the option so that access times are written out immediately. That means that with a crash you would probably have all the access times properly updated, with the exception of the very few that were in the process of being written when the crash occurred.
    2. Re:if you store them up you could lose them all by Marxist+Hacker+42 · · Score: 1

      if you lose power you're in trouble because now you have all those pending (how many?) atimes that you just lost. and you don't know how many and for what files so if you rely on atime for something then you suddenly no longer can for any of those files (but which ones? - you have no way of knowing)..

      If you lose power, then you've lost the rest of the saves in the cache as well- thus there was no additional access to the physical file past the initial read anyway. If anything, this makes atime MORE accurate, as it only refers to the physical file, as opposed to the cached copy as well (which may or may not have written).

      --
      SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
    3. Re:if you store them up you could lose them all by adrianbaugh · · Score: 1

      Doesn't matter. (Standards-wise anyway.) After a crash it is POSIX-compliant for the atime of a file to be undefined.

      --
      "'I pass the test,' she said. 'I will diminish, and go into the West, and remain Galadriel.'"
      - JRR Tolkien.
  20. C'mon guys -- no "itsatrap" tag? by weston · · Score: 1

    If ever there were a time to bring it back...

  21. would this help the "locate" utility? by bzipitidoo · · Score: 1

    The update part of the "locate" utility bugs me. First time that thing went off when I was at the PC, causing all kinds of mysterious disk activity, I thought I'd just been hit by a virus. Now I make sure to remove "locate" entirely from all my systems. Wonder how much "noatime" would help? I'd probably still keep "locate" off my systems.

    --
    Intellectual Property is a monopolistic, selfish, and defective concept. It is "tyranny over the mind of man"
    1. Re:would this help the "locate" utility? by Skater · · Score: 2, Informative

      No.

      You could schedule the update (updatedb) to run at a more convenient time.

      Locate is a pretty useful command - locate file, and it shows you instantly where it is. I don't use it a lot but when I do it's VERY handy to have.

    2. Re:would this help the "locate" utility? by rossz · · Score: 1

      The exact same thing happened to me many many years ago. I was fairly new to Linux so when that bastard kicked off I started to panic.

      --
      -- Will program for bandwidth
    3. Re:would this help the "locate" utility? by Megane · · Score: 1

      It's more fun when updatedb kicks off at 4AM... and you're sleeping next to the computer. There's nothing quite like the rattle of a find command to startle you awake from a deep sleep.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    4. Re:would this help the "locate" utility? by Anonymous Coward · · Score: 0

      You could schedule the update (updatedb) to run at a more convenient time.

      Such as when I'm not using the computer, and thus it's turned off?

      Not everyone have their own server room where the computer will run 24/7, and can do stuff like updatedb at 4 AM. For me, 4 AM means the power is off, and I'm sleeping next to the computer (it's in my bedroom), unless I'm playing late at night, in which case I do absolutely not want it to start running updatedb.

    5. Re:would this help the "locate" utility? by Skater · · Score: 1

      Or you could just run it before you shut down in the evening (updatedb || shutdown, or put it in the rc scripts). Or you could have it when you start up. Or you could have it run when you go eat lunch. Or...well, I think you get the idea. I didn't say anything about leaving your computer run 24/7, nor is it necessary to have an updated locate database.

  22. Laptop power issue. by Ungrounded+Lightning · · Score: 2, Informative

    So every time a file is used, it has to write an entry on the HDD, slowing performance,... so I have the noatime line in my fstab.

    I have noatime set on my laptop.

    Writing atime to the disk every time data is read from the cache keeps the disk spinning, burning battery power. "noatime" means the disk can shut down much of the time, spinning up only when writes must be synced or data not yet in cache must be read.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
    1. Re:Laptop power issue. by GoRK · · Score: 5, Informative

      Just a handy tip for you (if you don't already use it) or others who are looking at disabling atime more for the power savings than the IO -- on laptops you should also be using noflushd (non-journaling filesystems only) or (ideally) Laptop Mode Tools. Also do not forget to configure syslog so that it doesn't constantly sync writes.

      It's also worth mentioning that you *can* have atime enabled with properly configured laptop-mode and laptop-mode-tools and still see almost as much power savings -- The atime writes will still happen, but at least they will be buffered for when the HDD actually needs to spin up and do a lot of other more pressing IO.

    2. Re:Laptop power issue. by Eideewt · · Score: 4, Informative

      I'm not sure your link is correct.

    3. Re:Laptop power issue. by Anonymous Coward · · Score: 0

      Well at least it wasn't that kinky cat porn link. Phew!

    4. Re:Laptop power issue. by Anonymous Coward · · Score: 0

      Mistake or maybe it's an attempt at a rather strange GoogleBomb? :-)

      Correct link to Laptop Mode Tools, for the lazy.

    5. Re:Laptop power issue. by ilithiiri · · Score: 2, Informative
      --
      If anyone can hear me, slap some sense into me But you turn your head, and I end up talking to myself
    6. Re:Laptop power issue. by GoRK · · Score: 1

      That would be quite a bizzare Google Bomb indeed.

      However instead it was a product of two things that I have:

      1) An IM client that auto-copies URL's to the clipboard
      and
      2) Completely insane friends.

      I'm not sure how a pillow with nipples produced for cats is going to help your laptop save power, but certainly it won't hurt. I just hit Ctrl-V and a URL came out so I assumed it was the one I had just copied.

  23. Wow by quantum+bit · · Score: 2, Insightful

    I can't believe this is even an issue. I've been mounting everything noatime on my BSD systems for ages. The only thing I can think that it might possibly be used for are scripts that purge /tmp of files that haven't been accessed in a while. Even for that, ctime or mtime isn't a bad compromise.

    Bit of trivia -- NTFS does the exact same thing with regards to access times. There's a registry entry to disable it buried somewhere deep that I don't remember at the moment, but if you're stuck on Windows it might be worth looking up to improve I/O performance.

    1. Re:Wow by dj_tla · · Score: 2, Informative
      Good point! Here's how to turn it off:

      fsutil behavior set disablelastaccess 1
      Or if you just have to hack the registry:

      Hive: HKEY_LOCAL_MACHINE
      Key: SYSTEM\CurrentControlSet\Control\FileSystem
      Name: NtfsDisableLastAccessUpdate
      Type: REG_DWORD
      Value: 1
    2. Re:Wow by Anonymous Coward · · Score: 0

      You're right about NTFS because I remember doing some simple forensics to figure out when/how a Windows machine was compromised. The access times were quite helpful. I remember thinking at the time that while it was useful, the performance cost of saving all that stuff must be significant if files were being accessed frequently.

      Anyway, I googled and you're right that there is an equivalent to "noatime" for the access time feature in NTFS. It's number 8 in the list on that page ("Disable Last Access Time"). The command is apparently:

      fsutil behavior set disablelastaccess 1

      So, it is setting disable to true (double-negatives are confusing!).

      I haven't tried using fsutil before. Make sure you know what you're doing, YMMV, etc. (the Microsoft page says that some backup software uses the last access times, so be careful). The relevant registry key is "NtfsDisableLastAccessUpdate", but I don't know when it is used or when it it is safe to change it.

      Apparently something like this is available in Vista as well, but storing the last access time is disabled by default for better performance (so, disablelastaccess is already 1, I guess).

    3. Re:Wow by Anonymous Coward · · Score: 0

      Can you toggle this setting per volume ID or partition?

    4. Re:Wow by Anonymous Coward · · Score: 0

      NTFS does it in an intelligent fashion, however. The last access time has a resolution of one hour, so it does not need to be updated on every read.

    5. Re:Wow by arth1 · · Score: 1

      How is that intelligent? It removes the most useful feature of atime -- to run a command, and then check whether files have been read or not by listing the atime. Is the Microsoft Way to wait for an hour between test runs, or write a special utility that keeps a notify on all the files?

      Also, I would not necessarily recommend turning off atime on NTFS, as it's used by defragmenters to increase speed by placing files that haven't been accessed in a while far away from the busy areas on the disk. This improves both overall access time and read-ahead hits.

      Back to Linux, there's software that depends on the atime. The Netscape Proxy server, for example, zonks files based on atime and size.
      I'm not sure whether the squid proxy server uses atime or not for lru cache expiry. Some squid experts here who can say for sure?
      There's also cleaners for news spools that, if you keep an "old" school spool with one post per file, will remove old posts based on when they were last accessed.

    6. Re:Wow by Old+Wolf · · Score: 1

      Appropriate subject! If I try this modification in World of Warcraft, it drops my framerate from 60fps to about 5fps. No idea why.

    7. Re:Wow by Wyzard · · Score: 1

      Linux has the "noatime" option too; it's been there for ages. The problem being discussed is that noatime isn't the default in most distros, and many people don't know about it, so a majority of Linux systems are suffering an I/O performance hit due to atime updates that they don't really need.

      Most of the debate centers around whether the kernel should provide a configuration setting to mount everything noatime automatically, without having to specify it in /etc/fstab for each filesystem.

    8. Re:Wow by dj_tla · · Score: 1

      o_O That's bizarre... did you restart? Restarting fixes everything!

    9. Re:Wow by TheNetAvenger · · Score: 2, Informative

      Bit of trivia -- NTFS does the exact same thing with regards to access times. There's a registry entry to disable it buried somewhere deep that I don't remember at the moment, but if you're stuck on Windows it might be worth looking up to improve I/O performance.


      Bit of additional trivia, Vista already disables it by default, and the whole access timestamp mechanism has changed, removing this performance penalty all together.

    10. Re:Wow by quantum+bit · · Score: 1

      Aha! That's it. The last time I did that was on Windows 2000 Server and I remember using the registry key to do it. fsutil must be new (XP?)

    11. Re:Wow by pelrun · · Score: 1

      Atime is critical for systems that use hierarchical storage management; without atime an HSM can't know which files can be safely moved off to a slower/cheaper tier. Of course, that's not normally something used on your personal pc.

  24. Re:Never!! by utopianfiat · · Score: 2, Funny

    I thought I'd tack this onto the FP, but the OP is severely mistaken. First of all, Ingo was the one who finally submitted the patch, and it was also Ingo who made the 'faster than all the improvements over the last 10 years combined' statement.
    If you don't believe me RTFA. I just wish the OP had actually read the article before submitting it.

    --
    +5, Truth
  25. O RLY? by Anonymous Coward · · Score: 0

    Why don't they just implement something like SOFTUPDATES a la BSD?

    1. Re:O RLY? by Wyzard · · Score: 1

      How do you think that would help with the problem of writing lots of unnecessary atime updates to disk?

      It could help if you're repeatedly re-reading the same file, because most of the file's atime changes will just overwrite each other in RAM and only the last one will be flushed to disk, but the real problem is when a bunch of different files are being read, and you have to update the atime on all of them. I don't see soft updates helping with that.

  26. atime = access time is useless (inutil!). by Anonymous Coward · · Score: 0

    Remove the 4-byte timestamp of "access time" of all inode of each file.
    Only 4-byte timestamp of file's "modifying time" is needed.

    When you read some file, it implies updating access time, it writes the timestamp to disk if you don't want write anything in the file!!!

    Without "access time" timestamp, the filesystem will go fast with less writings!!!

    It's valid upto 2038 because of 32-bit timestamp.
    It's better to use 64-bit timestamp in us instead of s.

  27. latest relatime patch by Ingo+Molnar · · Score: 5, Informative

    Hey, Slashdot posted an article about me! [ They also renamed me to Linus - what more can a geek ask for? ;-) ]

    In any case, the latest version of the better-relatime patch can be picked up from:

    http://redhat.com/~mingo/relatime-patches/

    Apply it, build it, reboot into the new kernel and enjoy a faster (and lower latency) desktop. (no fstab twiddling needed)

    1. Re:latest relatime patch by Anonymous Coward · · Score: 5, Funny

      I agree - modifying a text file is a messy complicated business only suitable for the elite super hackers out there. It's much simpler for me to apply the patch and recompile the kernel.

      I kid, I kid.

    2. Re:latest relatime patch by tknd · · Score: 1

      They also renamed me to Linus - what more can a geek ask for? ;-)

      Perhaps, relatime overlord?

    3. Re:latest relatime patch by kollywabbles · · Score: 1

      I couldn't run the file so I changed the extension from .patch to .exe and tried to run it, and then Windows crashed. It didn't make my desktop faster at all. :)

      Actually - thanks for this. I'm going to give it a whirl tonight.

      --
      put it in the bit bucket
    4. Re:latest relatime patch by Ingo+Molnar · · Score: 5, Informative

      I agree - modifying a text file is a messy complicated business only suitable for the elite super hackers out there. It's much simpler for me to apply the patch and recompile the kernel.

      I kid, I kid.

      ok, you are kidding, but i'll still bite :-)

      Firstly, the patch is mainly about modifying relatime behavior to make it more compatible and more usable.

      The fact that you dont have to change fstab is no big deal, provided you have the right util-linux package installed, with the relatime user-space patch applied which not even the latest distro devel repositories have included.

      If you dont have that then adding "relatime" to your fstab might leave you with a read-only mounted root filesystem and some commandline (or rescue-image) tinkering to do.

      People prefer all-in-one kernel patches that just turns on the feature they are interested in. You'd be surprised how many people are willing to try almost arbitrary kernel patches but loathe to touch their user-space environment in any way.

      And ... it's also kind of ironic that this relatively small patch often brings more practical benefits to the desktop than all the "big" desktop interactivity/latency features (cfs, swap-prefetch, -rt kernel) combined.

      Ingo^H^H^H^H Linus

    5. Re:latest relatime patch by vrmlguy · · Score: 1

      Hey, how about changing case 1 from "atime (now() - mtime_ctime)/2"? This would cause the calulated atime to roughly track the actual atime, at least for the first relatime_interval seconds of the file life.

      --
      Nothing for 6-digit uids?
    6. Re:latest relatime patch by Karellen · · Score: 1

      Hey, do you ever get that mixed up with http://redhat.com/~mingo/realtime-patches/ ? :)

      --
      Why doesn't the gene pool have a life guard?
    7. Re:latest relatime patch by Karellen · · Score: 1

      Sorry, can't resist. You should also create a http://redhat.com/~mingo/leartime-patches/ set to translate all the kernel messages into Shakespearian English.

      --
      Why doesn't the gene pool have a life guard?
    8. Re:latest relatime patch by Anonymous Coward · · Score: 0

      People prefer all-in-one kernel patches that just turns on the feature they are interested in. You'd be surprised how many people are willing to try almost arbitrary kernel patches but loathe to touch their user-space environment in any way. That's a surprising statement in this context. I use things like noatime in fstab or things in /etc/modprode.d (ubuntu) that tweak things (sometimes in a way that is required for the system to run properly). Pushing more things into a userland configurable space where it becomes a nop in kernels that don't support it seems like the right approach to me. Changing the kernel to natively support an easily applicable userland tweak seems like overkill. If anything, major linux distros should simply default to noatime when the user configures a desktop version of the software.

      A user that isn't smart enough to understand what noatime does probably doesn't care enough about performance to require the kernel patch. "Fixing" atime shouldn't be a kernel decision but an informed user decision or a distro decision based on the likely use of the machine. To me, this change is akin to having DMA on a disk by default. It may break older hardware (or, in this case, software), but, it's not hard for a distro to detect this and do the right thing.
    9. Re:latest relatime patch by Wyzard · · Score: 1

      People prefer all-in-one kernel patches that just turns on the feature they are interested in.

      I have mixed feelings about this. On one hand, I feel that the default should be the standards-compliant behavior, and deviations from standards-compliance should be made explicit in /etc/fstab. On the other hand, not everything that's mounted is in fstab anyway -- I'm thinking of auto-mounting of hotplugged USB devices, whose mount options are chosen by some volume-manager program. (Though, these are usually FAT filesystems, which doesn't support atime anyway, AFAIK.)

      Reading through the thread, the idea that caught my attention the most was Arjan van de Ven's suggestion of adding an "atime-dirty" state for inodes, which by itself won't trigger any disk I/O. Theodore Tso pointed out in a reply that this would be tricky to implement "right", but in a long-term sense it seems like the best solution, since it avoids the current atime problems, while still being completely standards-compliant. noatime and relatime both seem like interim hacks in comparison.

    10. Re:latest relatime patch by Anonymous Coward · · Score: 1, Interesting

      I've read the TFA and IMHO it seems that this could be improved without sacking the concept of atime.

      1. First, we need a common journal, listing all files currently open (or at least open for read access).
      2. periodic atime update is done ONLY for said journal, not for individual files.
      3. We write down individual atimes for those open files at the time they are closed, or on recovery (if system goes belly up before closing them), from said "open files" journal's atime, which was updated regularly.
      4. For all files that are currently (perhaps permanently ... or just very long time) open, atime request returns current system time.
      (5. ???
      6. Profit!)

      For most TFA-mentioned purpose of atime, proposed hack could do just fine. However, here lies a hypothetical problem:

      If two processes synchronize on a file, so that one process writes information the other reads, then "writer" may rely on atime to find out when this information was "consumed" by "reader" (when exactly last actual read() was called). If both "reader" and "writer" keep their file descriptors open throughout their run times, then "writer" will be each time (mis)informed that last piece of information written was readily read, whenever it fetches atime of said file.

      Perhaps such specific usage should be something of a special feature, a flag, set if needed by "reader" at open() request?

    11. Re:latest relatime patch by 12357bd · · Score: 2, Interesting

      And ... it's also kind of ironic that this relatively small patch often brings more practical benefits to the desktop than all the "big" desktop interactivity/latency features (cfs, swap-prefetch, -rt kernel) combined.

      Talking a bout desktop interactivity, it seems you missed to mention Con's scheduler in gamming scenarios, curious eh?.

      --
      What's in a sig?
  28. When a file is modified the create time is moot by Anonymous Coward · · Score: 1, Insightful

    If all you keep track of is attributes on an entire file basis, once a file is modified the create date no longer has any meaning.

    1. Re:When a file is modified the create time is moot by EvanED · · Score: 1

      That depends on what you're trying to do. Can you really not think of any uses for creation time?

      I would much rather have creation time than both ctime and mtime.

    2. Re:When a file is modified the create time is moot by Breakfast+Pants · · Score: 1

      Name one single use.

      --

      --

      WHO ATE MY BREAKFAST PANTS?
    3. Re:When a file is modified the create time is moot by twistedcubic · · Score: 2, Insightful


      Name one single use.

      There is a file on my drive, and I want to find out when it was created, just out of curiosity?

    4. Re:When a file is modified the create time is moot by springbox · · Score: 1

      With digital cameras that keep track of time, it's useful to have a "creation time" for files so you know when pictures were taken.

    5. Re:When a file is modified the create time is moot by Nevyn · · Score: 0

      There is a file on my drive, and I want to find out when it was created, just out of curiosity?

      But you downloaded it from a website, deleted it and restored it from backup, copied to a USB stick and back (to take it somewhere else and edit) or emailed it to yourself from work ... and you forgot. So you know you've had it for at least 3-4 years and the "creation date" says 18 months ago.

      Sounds like a great feature.

      --
      ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
    6. Re:When a file is modified the create time is moot by Anonymous Coward · · Score: 0

      If you're using primitive file systems with little or no support for metadata, that's what might happen. On the other hand, I have some Mac files from the 90s which have been copied through multiple computers, compressed, decompressed, backed up, restored etc., and they still say "Creation date: August 18, 1992".

      I don't see why you'd have to assume that a feature is useless or cannot work simply because the systems you're familiar with have not supported it.

    7. Re:When a file is modified the create time is moot by Chris+Pimlott · · Score: 1

      With digital cameras that keep track of time, it's useful to have a "creation time" for files so you know when pictures were taken.

      EXIF data will take care of that, which is pretty much universally supported in digital cameras. There are plenty of tools out there to sync

  29. weaker atime might be adequate by Ungrounded+Lightning · · Score: 1

    Because if you do that, you can't trust the access times in case of a crash. ... One solution to the problem, might be to write the atimes to the journal, and then just update it once in a while, or perhaps even link the atimes to some seperate part of the disk, so the atimes can be written in one go somehow.

    Another might be a "weakatime" option, to update the atimes in the inode cache but mark them as something weaker than "dirty" ("sumdged"?) when the data is re-read from cache. Opening, last closing, or reading more data to the cache would still dirty the inode. "Smudged" inodes would be written:
      - If something else really dirtied the inode (i.e. updating wtime or last close of the file).
      - The next time there is a sync that is the result of a command or has to write an actually dirty sector (so you won't spin up a laptop disk at periodic sync time just to update atimes)
      - Just before the file system is unmounted.

    A weaker version yet would be "wimpyatime", in which additional reads to cache after the open would "smudge" rather than "dirty" the inode. (This would be equivalent to "weakatime" with a file system that cached the entire file on open.)

    But caching the atimes in memory is a recipe for disaster and inconsistency!

    Not completely. They'd be updated on disk when the file is opened and (except for "wimpyatime") when new sectors are read into cache. You'd just delay the continual updating on the hard disk when an already open file is examined further. There'd be more inconsistency if the system crashed rather than shutting down gracefully, but you'd still be able to see that the file had been open.

    --
    Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
  30. noatime on Mac OS X by Weezul · · Score: 1

    How does Mac OS X handle atime? Is their a noatime option?

    --
    The Christian religion has been and still is the principal enemy of moral progress in the world. -- Bertrand Russell
  31. Is this reason why we cant spin down disks? by grims · · Score: 4, Interesting

    On of my gripes with Linux is that one cannot spin down the disks to lessen their wear and tear.
    Ive been told that the kernel constantly needs to access the disk...

    Is this the reason of something else prevents the disks from spinning down?

    1. Re:Is this reason why we cant spin down disks? by feld · · Score: 1

      you're hurting the disks more every time you spin them back up. the spin down is a very dangerous but power saving trick.

      if you value the longevity of your drives and your data, you wont use it.

    2. Re:Is this reason why we cant spin down disks? by rahvin112 · · Score: 4, Informative

      Stopping and Starting a disk causes the most wear on the disk. When in an idle state the spinning disk has fully lubricated bearings and is using just a tiny amount of energy. Strap in a stop and start and you have bearings on start that don't have their lubrication optimally spread (gravity and lack of motion cause the metal to get closer together and depending on the manufacturer may have some of the bearings without lubrication), and the spinup of the disks themselves is on average a 6W draw (idle is like .3W). Plus, when the disks are fully spinning wobble is going to be constrained a bit by the speed, whereas on startup and stopping the minor imperfections in the disk can let the minor wobbles show which strains the bearings and causes wear and tear. See if the bearings start to fail and are say 20% shot, the motor on the drive can just use a little more energy to drive them, but the startup cost might exceed what the motor is capable of outputing. Using the example above, the .3W draw on idle might climb to .6W, but on startup that could translate in moving from 6W to 12W (and exceeding what the motor can physically provide).

      And if you don't believe any of that you shouldn't have any trouble using google to find Admins who tell horror stories about having to reboot a drive and losing the entire drive because the bearings were shot to the point that once the disks stopped the motor couldn't generate enough force to restart them. But the disk could have lasted years more as long as it wasn't stopped. In fact in companies where a lot of data is stored the disks are put on their own power source at least partially because the disks don't have to be stopped if a server needs to be rebooted because of failure or updates. This is also one of the reasons to be wary of purchasing used storage arrays. Might have worked great when they shut it off, but you might be able to restart the array.

    3. Re:Is this reason why we cant spin down disks? by AME · · Score: 1
      Ha! You've reminded me of when I needed to use a pencil eraser against the exposed end of the drive shaft to manually spin it up on an old hard drive way back in the day.

      Sorry. Showing my age...

      --
      "I have a good idea why it's hard to verify programs. They're usually wrong." --Manuel Blum, FOCS 94
    4. Re:Is this reason why we cant spin down disks? by themildassassin · · Score: 1

      Use hdparm -S to set spindown times for hard drives under linux. I don't blame you for not knowing though, I always thought it was silly Gnome and KDE don't have this setting under their power savings options.

    5. Re:Is this reason why we cant spin down disks? by dbIII · · Score: 2, Informative
      I've never bothered to do this but I have talked to people who have and there are a few options.

      Syslog is often the culprit so if you can get it to stop writing log files all the time your disk can sleep longer. There is a syslog out there somewhere that limits it's writes to disk to when it fills a cache - the quick hack otherwise with an unchanged system is to get it to dump logs to a ram disk (kernel parameter on boot to enable ram disks) and sync every day or whenever.

      Another thing is cron - work out what it is doing and if it really needs to run that thing every hour, day or whenever and wake up the disk.

      That's a start - I think there's actually a HOWTO on running linux with a minimum of power usage that is a few years old that goes into this.

    6. Re:Is this reason why we cant spin down disks? by Trelane · · Score: 1

      More than that, you can tweak APM too (-B)

      --

      --
      Given enough personal experience, all stereotypes are shallow.
    7. Re:Is this reason why we cant spin down disks? by Just+Some+Guy · · Score: 1

      I always thought it was silly Gnome and KDE don't have this setting under their power savings options.

      They probably didn't want to deal with the sudden onslaught of users with ruined drives.

      --
      Dewey, what part of this looks like authorities should be involved?
    8. Re:Is this reason why we cant spin down disks? by heinzkunz · · Score: 1

      And if you don't believe any of that you shouldn't have any trouble using google to find Admins who tell horror stories about having to reboot a drive and losing the entire drive because the bearings were shot to the point that once the disks stopped the motor couldn't generate enough force to restart them.

      My first HD was a used 5 1/4 drive with 10 MB capacity that couldn't start on its own. I had to jump start it using a sturdy piece of wire on an exposed rotating part.

      But I doubt that something like that could happen today, given the much higher data densities and smaller tolerances in the hardware.

  32. As a flash fs writer... by EmbeddedJanitor · · Score: 5, Informative
    atime really hurts some file systems, particularly flash file systems. Many/most flash file systems don't support atime for that reason. So, even if you're running atime in the kernel you will often not be getting atime in the fs.

    If you're using a desktop system with a hard disk you'll hardly notice any difference unless you hammer the system really hard.

    Remember though that most Linux systems are either embedded (using mainly flash) or servers. In both these cases atime updates can be very damaging to performance and should be avoided unless there's a very good reason to turn it on.

    --
    Engineering is the art of compromise.
    1. Re:As a flash fs writer... by Anonymous Coward · · Score: 1, Funny

      Whilst we're at it, we should also get character echo disabled.
      Systems would be so much faster!

    2. Re:As a flash fs writer... by Anonymous Coward · · Score: 0

      While you're at it, we need to get you laid.
      Your attitude would be so much better!

    3. Re:As a flash fs writer... by Deliveranc3 · · Score: 1

      Was this filesystem included BECAUSE it was supposed to deal with Flash? In that case job poorly done?

      I guess this will be the last Linux filesystem effort before they move on to Flash.

      Dude this thing might last 50 years! :P

  33. Mount noatime by redelm · · Score: 2
    Unless I have strong reason otherwise, I put `noatime` in /etc/fstab options column for all filessystems, including especially / .

    Problem solved. Many older/slower machines [laptops] can be sped up considerably by this step.

    1. Re:Mount noatime by complete+loony · · Score: 1

      You have a filesystem for /. ?

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    2. Re:Mount noatime by redelm · · Score: 1

      You missed the space between / and . ending the sentence. -5 geek points :)

    3. Re:Mount noatime by complete+loony · · Score: 1

      See that up there? That's my attempt at humour going over your head. I could have hinted at a gmailfs style filesystem that posts /. comments for online storage, but I'd already hit submit.

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    4. Re:Mount noatime by redelm · · Score: 1

      Lame attempt. Now do you see why smileys are important?

  34. NTFS by inKubus · · Score: 3, Insightful
    NTFS has last access also (on by default).

    You can disable it in a few different ways

    fsutil behavior set disablelastaccess 1
    Once this is done, the Last Access Time attribute for newly created files will simply be their File Creation Time. Disabling Last Access Time may affect the operation of backup programs that use the Remote Storage service. YMMV

    Or there's a registry key, which requires a reboot:

    System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr ol\FileSystem]
    Value Name: NtfsDisableLastAccessUpdate
    Data Type: REG_DWORD (DWORD Value)
    Value Data: (0 = disable, 1 = enable)
    --
    Cool! Amazing Toys.
    1. Re:NTFS by shird · · Score: 2, Informative

      This setting appears to be disabled by default on Vista. (ie atime is not set). Which makes sense with the amount of thumbnail viewing that goes on in that OS.

      --
      I.O.U One Sig.
    2. Re:NTFS by TheNetAvenger · · Score: 1

      This setting appears to be disabled by default on Vista. (ie atime is not set). Which makes sense with the amount of thumbnail viewing that goes on in that OS.


      Yes it is disabled by default in Vista, and the 'Last Access Update' is addressed in another way on Vista. So unless an application SPECIFICALLY checks for this timestamp or flag, Vista handles this in another way and it should be left off.

      However, even though this change does increase performance it has nothing to do with performance regarding thumbnails.

      1) Windows had Thumbnails going back to Win95 and especially in XP with the enhanced Thumbnail size introduced. So they are not 'new' in Vista. (XP even had the same shell filters etc, although Vista does expand the features with a few new APIs and the ability to resize Icon Views on the fly easier.)

      2) Thumbnails are cached, so the files are not being read everytime they are viewed in Explorer or Photo Viewer. In older versions it was a local cache (in the folder), and in Vista the thumbnails are cached in a central store that works with the Searching service. (This also works over network connections just like the new Searching service does, so a local machine can just ask the remote server/system for the cached images, just as it can do remote queries on the remote search index.)

    3. Re:NTFS by Anonymous Coward · · Score: 0

      with option '1' you enable 'NtfsDisableLastAccessUpdate', which means you disable the Last Access Time Stamps. just to make it clear.

  35. You can fix the file system by EmbeddedJanitor · · Score: 1

    Not all file systems support atime, and they can tell the kernel that. Result: that fs does not get the atimer performance hits.

    --
    Engineering is the art of compromise.
    1. Re:You can fix the file system by vox_soli · · Score: 1

      I meant without changing the semantics. atime is actually used for a few things.

  36. Speedup with noatime by Bill+Dimm · · Score: 1

    I did a document clustering calculation with 1.3 million small documents (average 2903 bytes each) stored on a Reiser3 partition. Mounting with noatime cut the time to read the documents from disk by 27%, and cut the time to read from cache by 52%.

  37. atime on EXT3, huh? by Trogre · · Score: 4, Funny

    (mount ext3 filesystem with noatime flag)

    $ time for i in `seq 1 10000`; do touch file1.dat; done

    real 0m15.231s
    user 0m3.075s
    sys 0m11.970s

    $ time for i in `seq 1 10000`; do cat file1.dat >>/dev/null; done

    real 0m14.326s
    user 0m2.928s
    sys 0m11.172s

    (remount without noatime flag)

    $ time for i in `seq 1 10000`; do touch file1.dat; done

    real 0m12.629s
    user 0m2.687s
    sys 0m9.772s

    $ time for i in `seq 1 10000`; do cat file1.dat >>/dev/null; done

    real 0m12.401s
    user 0m2.624s
    sys 0m9.624s

    Yes I think I'll stick with atime for now, thanks Linus.

    --
    "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
    1. Re:atime on EXT3, huh? by Elladan · · Score: 2, Informative

      Your test is invalid. Try again with 10000 different files, and make sure you unmount/mount before each test.

    2. Re:atime on EXT3, huh? by shird · · Score: 1

      You are ignoring reading from a cached file, that then requires a seek on the HD in order to write. If you read in 100 small files scattered about your HD that have been cached, I think you would notice a fair difference if the kernel does or doesn't have to seek to each file to write its atime.

      --
      I.O.U One Sig.
    3. Re:atime on EXT3, huh? by Chris+Burke · · Score: 1

      Looks to me like you got a ~13% reduction in execution time in a somewhat ideal test (only touching one file).

      13% is a pretty significant speedup. Especially if they can provide that speedup while also providing most of the functionality of atime.

      --

      The enemies of Democracy are
    4. Re:atime on EXT3, huh? by Trogre · · Score: 1

      I can't quite tell from your comment, but if you didn't notice, my (cached) test showed a ~13% reduction in execution time with atime over the execution time with noatime.

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
    5. Re:atime on EXT3, huh? by johnm76 · · Score: 1

      Beeing fairly new to Linux I found the article interesting - and tried. With success I would say. I cannot provide statistics as I have no idea on how to provide such tests, but I feel I don't need to. I'm an amateur photographer and use Bibble as my photo editing software. All my pictures are shot in RAW (approx. 5 mb pr. file) and I store between 200 and 500 files in each folder. What I noticed is that the loading of thumbnails (cached and not-cached) is way faster when noatime-option is activated (/etc/fstab + reboot). If I would make a guess I would say around 50% of the time is needed in order to provide the thumbnails and some 75% for single picture rendering. Although I cannot confirm my "numbers" it's a clear and noticeable performance boost. Regular browsing yielded no noticeable result as to speed, but the temperature of my laptop seems a tad cooler (although I admit that might as well be my imagination). Nevertheless; Bibble + RAW + lots of files in combo with noatime gave performance boost. No doubt!

    6. Re:atime on EXT3, huh? by Anonymous Coward · · Score: 0

      And before you say 'but how often do you read in 1000s of cached small files' think about viewing thumbnails of image files in a file system, as another poster has commented. Not having to seek and write for each file when reading in many cached files will net you a massive boost IMHO.

    7. Re:atime on EXT3, huh? by Chris+Burke · · Score: 1

      Hehe, oops, no, I didn't notice that, I misread it as the opposite.

      So this is what you get for trying to optimize. :P

      --

      The enemies of Democracy are
    8. Re:atime on EXT3, huh? by zmotula · · Score: 2, Funny

      >>/dev/null? Unix joke of the year :-)

    9. Re:atime on EXT3, huh? by Trogre · · Score: 1

      Yes I guess it could be taken as funny I suppose :)

      I was just timing read operations and cat >>/dev/null was the first thing that came to mind.

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
  38. The units in seconds are a bug of Unix. by Anonymous Coward · · Score: 0

    POSIX compliant? POSIX's BUG compliant?

    If the OS writes 10'000 files per second to the ramdisk/diskcache/disk sequentially one after other, then

    WHY EACH 10'000 FILES HAVE THE SAME 32-bit TIMESTAMP IF THEY ARE WRITTEN SEQUENTIALLY???

    YOU DON'T KNOW WHAT FILE WAS WRITTEN AFTER OF OTHER FILE AND IT CAN BE A PROBLEM.

    1. Re:The units in seconds are a bug of Unix. by Anonymous Coward · · Score: 0

      Or such bug exists at low speed of 1.01 files/second or 2 files/second.

      If the units are in nanoseconds, does the bug exist in the speed of 1'000'000'001 files/second? Yes.
      And 500'000'000 files/second to know +1ns increment to assure that not same 64-bit timestamp ocurrs? I don't know it.

      # smartctrl -a -d ata /dev/sda
      # smartctrl -a -d ata /dev/hda

      You see many millions of millions of Seek_Error_Rate!!!
      Fear, fear, fear to lose the data because of error of seeks!!!!
      Dangerously, not? Hahaha, joking.

      If you disables atime (and diratime) then you minimizes a little bit the Seek_Error_Rate count!!! It's my truth.

    2. Re:The units in seconds are a bug of Unix. by Anonymous Coward · · Score: 0

      You see many millions of millions of Seek_Error_Rate!!!
      Fear, fear, fear to lose the data because of error of seeks!!!!
      Dangerously, not? Hahaha, joking.

      noatime & nodiratime can reduce the probability of failure/crash in the theory of MTBF and can reduce the energy to turn on the laptop's disks.
      The writes of FLASHes are in "64 KiB blocks" and if anything access to one file then it erases & writes "64 KiB block" for the writing of 64-byte inode's access timestamp!!! They are evil too!!!

      $ for f in $(seq 1 21) ; do cat /dev/null > file$f.trash ; done ; ls -1tr | tee order_trash.log ; rm -f file*.trash
      file9.trash
      file8.trash
      file7.trash
      file6.trash
      file5.trash
      file4.trash
      file3.trash
      file21.trash
      file20.trash
      file2.trash
      file19.trash
      file18.trash
      file17.trash
      file16.trash
      file15.trash
      file14.trash
      file13.trash
      file12.trash
      file11.trash
      file10.trash
      file1.trash

      $ info ls

      -1 list one file per line
      -t sort by modification time
      -r, --reverse reverse order while sorting

      This result is faked according to the manual/specification of ls!

      The correct result must be in the reverse of the creation time order, not any order:
      file21.trash, file20.trash .. file11.trash, file10.trash .. file1.trash.

    3. Re:The units in seconds are a bug of Unix. by Guy+Harris · · Score: 2, Interesting

      Nothing about POSIX requires that it be impossible to get higher-resolution time stamps. You just can't get them with POSIX-only code.

      For instance, OS X (and possibly other BSD-flavored UN*Xes) either defines the time stamps, in "struct stat", as struct timespec st_[amc]timespec; and #defines st_[amc]time as st_[amc]timespec.tv_sec, or puts a long st_[amc]timensec; field after each time_t st_[amc]time; field, depending on whether _POSIX_C_SOURCE is defined - POSIX-only code will work, and non-POSIX-only code can get at the higher-resolution times.

      And the POSIX requirement for st_atime to be updated has nothing to do with the issue you're complaining about in any case.

    4. Re:The units in seconds are a bug of Unix. by Anonymous Coward · · Score: 0

      This one-second window where all files have the same timestamp matters. I had svn "hide" a changed file because I can made a change to it less than 1 second since doing an update. Many people can do an operation in a second that causes a timestamp to compare incorrectly, not many people can do this in a one one-millionth of a second.

      Jackass.

  39. Accounting is a nuisance in general by mi · · Score: 4, Interesting

    But sometimes you need it... Whether it is to project your savings or to figure out, if a particular file was read within the last year.

    My problem with atime is that it is not universal enough. For example, reading a file via mmap() or sending it directly to a socket via sendfile() (both methods widely used by web-servers) will not update its atime. The access-timestamp should be updated every time a file is opened for reading, rather than when a read() is issued on it...

    So, when I wanted to report, when my little piece of software was last downloaded (via HTTP), I could not, unfortunately, rely on the file's atime...

    --
    In Soviet Washington the swamp drains you.
  40. How about... by Anonymous+Cowhead · · Score: 1

    ...updating atime on close(2). It's been a long time, but I think that's what the best operating system of all time (TOPS-20) did.

    1. Re:How about... by Anonymous Coward · · Score: 0

      Actually, TOPS-20 had four times in the FDB (equivalent to the inode), as follows: .FBCRE date/time that the file was closed after last write .FBCRV date/time that the file was created .FBWRT date/time that the file was last written .FBREF date/time of last non-write access .FBWRT is roughly equivalent to mtime, and .FBREF is roughly equivalent to atime. There was no equivalent in TOPS-20 to UNIX ctime, just as there is no equivalent in UNIX to TOPS-20 .FBCRE and especially .FBCRV .

      One very useful feature that TOPS-20 had was an open mode that did not change any of the times. Thus, it was possible for programs to read a file without altering any of its times. On UNIX, you can set the atime/mtime back via utimes(), but that causes a change to ctime(); and of course the inode ends up being updated twice.

      I suspect that most of the desire not to write atime on UNIX would go away if there was a way for a program to read files without updating atime. Utilities such as grep and sum are obvious candidates.

  41. Actually... by dreddnott · · Score: 1

    A few comments up our venerable friend Twitter fell into the same trap:

    http://linux.slashdot.org/comments.pl?sid=264507&c id=20162589

    Considering how much editorial work the 'editors' around here actually do I wouldn't be surprised at people habitually auto-correcting the spelling in an article title and summary. Still, in the context of atime, relatime makes a little bit more sense than realtime.

    --
    I may make you feel, but I can't make you think.
  42. Re:When a file is modified, create time NOT moot by martin_henry · · Score: 1

    correspondence. you may want to know when you first began writing a letter.
    or you may want to know when you first installed a driver/application.
    etc etc etc

    --
    www.purevolume.com/martyd
  43. your keyboard is broken. by Gary+W.+Longsine · · Score: 1

    Set up a web site and take donations via Pay Pal for a new keyboard.

    --
    If you mod me down, I shall become more powerful than you could possibly imagine.
  44. File system caching? by MrLint · · Score: 1

    Ok other than at least the handful of possible problems I can think of, if you have a file open, why isnt that part of the file system data cached also? I apologize for the lack of deep analysis here, but if the argument is that if you want to store access time of a file that is in cache, and you have to hit the platter to update that time, and to save that non cache hit by not storing AT, then why not have that block of the file system cached when you open the file? When you close the file, you also do a final flush on that file system block, otherwise the cache gets flushed on the normal cache flush criteria?

  45. That's "Kernel", not Kernal... by BarnabyWilde · · Score: 1

    ...and yes, it DOES matter.

    Well, only if you want someone to actually _find_ what you wrote later.

    1. Re:That's "Kernel", not Kernal... by Anonymous Coward · · Score: 0

      Well, I understand and all, but if you were to research the Commodore 64 assembly language ROM routines, you would be disappointed.

      AC

  46. Incredible speed-up! by mattgreen · · Score: 1

    I enabled this on my Linux box, and it completely flies! Vista can't hold a candle to the speed I'm experiencing now! Just another great reason to use Linux!

    1. Re:Incredible speed-up! by Anonymous Coward · · Score: 0

      try turning off atime (ntfs access time) in vista for a more even comparison.

    2. Re:Incredible speed-up! by Anonymous Coward · · Score: 0

      Dude, atime's off by default in Vista! Check it yourself: "fsutil behavior query disablelastaccess" prints "1", right?

  47. yet another example of why I hate Microsalesmen by Joseph_Daniel_Zukige · · Score: 1

    What, you want to shoot yourself in the foot?

    Let my sell you the gun.

    I'll even put special features on it for you, such as laser sighting and recoil suppression and a silencer. (The silencer is so you can hear yourself scream.)

    If you report a creation time, you should report a creation time.

    That would mean your file system would be able to tell the difference between a file opened and saved under a different name and a file opened and created from scratch. And, since the concept of template is somewhere between ex-nihilo creation and simple editing, the file system should be able to tell the difference between ex-nihilo and templated creation, and saving under a different name.

  48. If you read the article further... by Ayanami+Rei · · Score: 2, Informative

    In the email discussion linked in the article kernel devs were wondering the same thing... why doesn't mutt/bash just use inotify on the mailbox/maildir if available at config/build time? (Linux does have a event system in epoll and inotify -- and we almost got that unified under kevent, and it's threatening to happen again pulling in AIO too)

    They were also concerned about breakage of other systems that are not open source (HSMs) which use atime for usage tracking. Noting that HSMs and atime-sensitive maintenance programs usually don't exhibit time resolution in policies more fine than a day, they came up with the relatime = update at least once a day compromise.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  49. The file info and the file data are distinct. by Ayanami+Rei · · Score: 1

    The inode representing the file and the file data itself are located at two different places on the disk. Both get read and cached when the file is opened and read.

    Op1) Read inode into memory (cached)
    --- "Open" file for reading (inode gets atime updated, cached inode is now "dirty")
    Op2) Read requested blocks of file into memory (cached) ... Some stuff happens with the file, and other files, or maybe nothing...
    OpN) bdflush getting impatient or a filesystem sync prompts the dirty inode to be written back out to disk and the memory reclaimed

    So for every file read, there are three distinct operations, one at location A on the disk, another at location B, then a third at A again.

    This is with normal atime behavior. Note that the operation at "N" is not done in a necessarily slow way; it might get batched in a bunch of delay writes to that region of the disk. But if your system isn't doing a bunch of reading and writing all over the disk, then this a very noticable seek in the grand scheme of things, especially if it's part of a linear search through files (like via grep or something).

    This relatime patch changes things so that the atime is noted in memory, but the inode is not actually considered a candidate for updating "dirty" unless the PREVIOUS value of atime was at least a day ago.
    If the file is opened for writing, then the atime gets updated anyway along with the mtime; that always happens as you need to update the inode anyway when the length or data blocks change.

    --
    THIS THING CAN TURN ON A DIME, MACROSSZERO STYLE ALSO FUCK BETA, ~NYORON
  50. I use atime _all the time_. by ZorkZero · · Score: 1

    I can't believe that I haven't seen more people coming down on the side of atime. I use it to troubleshoot very frequently. For example, if I try to start something up and it fails, I can easily see if it got as far as reading its config file by checking the atime on it. When I'm looking through a machine to find out what files are relevant to its current config, I can do an ls -lUrt and see what files were read recently and which haven't been touched for years. Yes, there are machines out there that have been cranking away doing production work for years. To do something, and then see what that something touched, is very handy.

    Also, you can kind of see what an intruder did on a machine by looking at the atimes on the shared libraries, header files, etc. on a machine that you think may have been compromised, especially if that machine normally just grinds away doing a couple different things most of the time.

    Seriously, that's what the noatime flag is for if you want it. But I would never use it unless I had a damn good reason.

  51. What effect, if any, does noatime have... by distantbody · · Score: 1

    ...on incremental or differential system backups? It would seem to have no relavance to them, but one must be cautious with such things.

    1. Re:What effect, if any, does noatime have... by Anonymous Coward · · Score: 0

      I think that access time must not impact on backups :) Why do backup software care when you read file?

      There is mtime for system backups

  52. But only slightly less well known is this... by Anonymous Coward · · Score: 0

    Never go in against a Hungarian when death is on the line!

    Aha-ha-ha! Haaa-ha-ha!! Ha--...

    [thud]

  53. *choke* by ascendant · · Score: 1

    The fact that you dont have to change fstab is no big deal, provided you have the right util-linux package installed, with the relatime user-space patch applied which not even the latest distro devel repositories have included.
    That is one hell of a sentence.
    --
    Do not attribute to malice that which can be easily explained by incompetence.
  54. Hybrid HDDs by TClevenger · · Score: 1

    This sounds like a job for hybrid hard drives. atime updates can be cached in the drive's flash RAM, and the drive only needs to spin up when the cache nears full.

    1. Re:Hybrid HDDs by pong · · Score: 1

      My thoughts exactly. Someone mod parent up.

  55. chattr by badc0ffee · · Score: 1
    from info chattr:

    When a file with the 'A' attribute set is accessed, its atime record is not modified. This avoids a certain amount of disk I/O for laptop sys- tems. This can be a file or a directory recursively with the "-R" option.
    --
    1011 1010 1101 1100 0000 1111 1111 1110 1110
  56. It made a difference for me.... by xgr3gx · · Score: 0
    I never knew about nodiratime, but I already used noatime.
    here are my results of each option doing a find and recursive ls:
    atime and diratime enabled:

    time find /home
    real 0m2.064s
    user 0m0.200s
    sys 0m0.232s

    time ls -R /home
    real 0m0.810s
    user 0m0.142s
    sys 0m0.144s
    with noatime

    time find /home
    real 0m0.984s
    user 0m0.076s
    sys 0m0.120s

    time ls -R /home
    real 0m0.791s
    user 0m0.120s
    sys 0m0.138s
    with noatime and nodiratime

    time find /home
    real 0m2.036s
    user 0m0.168s
    sys 0m0.180s

    time ls -R /home
    real 0m0.787s
    user 0m0.139s
    sys 0m0.136s
    Weird, for me it was faster with just no atime. This is on ext3. Maybe you need a large number of directories to see a boost with nodiratime.
    These are just simple tests, and are inconclusive. Your individual results may vary. All natural, no prescription needed! Call now! Oops, got carried away again.
    --
    Shameless plug alert: Game server control panel
    1. Re:It made a difference for me.... by Bronster · · Score: 1

      Wow - how did you flush the caches between those? How did you make sure there were no other programs requiring disk access at the same time? How...

      *sheesh*. Very much so. Nicely caught by the disclaimer of course.

  57. Great for porn by Anonymous Coward · · Score: 1, Interesting

    I use it to help with security checks (even though you can hack the atime record), to help debug (what input file caused it to hang?), and all sorts of things where it's useful to know when a file was read.

    I don't care about debugging and stuff, but it's really useful for my porn collection. If you have a big porn folder, just sort it by atime and you can see something "fresh" every day.
  58. Atime is used extensively by CustomDesigned · · Score: 2, Insightful

    for tracking which files are no longer used. That is why backup utilities such as tar have a --preserve-atime option to avoid updating atime during a backup. The proposed relatime option preserves the function of finding files no one uses anymore - for that purpose, 1 day resolution is fine. HSM systems depend on atime to know what to archive. Again, 1 day resolution is fine for that purpose.

  59. WinXP (Was "noatime on Mac OS X") by adisakp · · Score: 1

    I don't know about Mac's but it's easy to disable this feature (last access time) on Windows:

    "FSUTIL BEHAVIOR SET DISABLELASTACCESS 1"

    This tends to speed up removeable drives quite a bit. It's still a speedup but less of one on non-removeable drives.

    If you want a bigger speedup on removeable drives, you can also enable write-caching on a drive by performing the following steps: go to explorer "My Computer" and select drive-letter (i.e. "E:") -> select Properties (right-mouse menu) -> click Hardware (tab) -> select drive-hardware-device-name (in list) -> click Properties (button) -> click Policies (tab) -> select "Optimize for Performance" (radio button) -> click OK (button). Note if you do this you have to use the "Safely Remove Hardware" in the task tray to remove the drive or you can get write errors.

    1. Re:WinXP (Was "noatime on Mac OS X") by adisakp · · Score: 1

      Oh, and turning off indexing on a drive speeds it up too. It's on the drive properties dialog at the bottom as "Allow Indexing Service to..." .

  60. Is this just a Linux issue? by Kadin2048 · · Score: 3, Interesting

    Is this something that's limited just to Linux and the ext3 filesystem?

    I'm particularly curious as to whether it's an issue on Mac OS X with the HFS filesystem also, and whether it would be possible / advisable to force Mac OS X to mount the root HFS partition as noatime/nodiratime.

    OS X doesn't use a traditional UNIX-style fstab, so it's not immediately clear to me how you'd change the mount options (last time I checked disk mounting was all just in /etc/rc, but perhaps it's been moved into that new SystemStarter business since I last checked). It seems like the same things ought to apply to HFS -- it has an attribute that's functionally identical (at least, I think it is -- feel free to correct me on this) to atime, stored in the catalog file -- but I'm not familiar enough with the workings of the filesystems to know if that's actually the case.

    If this doesn't occur in other OSes (I picked OS X because it's the other OS that I use frequently, and it uses a default fileystem that's pretty different in design from ext2/3), it seems like it might be worthwhile to look at why that is, and what tradeoffs other OSes have made to avoid the same issue.

    --
    "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
    1. Re:Is this just a Linux issue? by Hal_Porter · · Score: 1

      Last access time updates slow things down affects all OSs and filesystems, even though some have a high granularity for atime updates, e.g. once per hour. NTFS used to enable atime updates by default but as of Vista it is disabled -

      http://blogs.technet.com/filecab/archive/2006/11/0 7/disabling-last-access-time-in-windows-vista-to-i mprove-ntfs-performance.aspx

      --
      echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
    2. Re:Is this just a Linux issue? by pknoll · · Score: 1

      In OSX > 10.4.9, although the /etc/fstab file is missing the automounter will pick up and use any settings present in that file.

  61. When did Linus get not so humble with his opinion? by Anonymous Coward · · Score: 0

    shocking. simply shocking.

  62. News at 11- Linux Kernel Developers discover atime by TheLink · · Score: 1

    It shows how much of specialists they are and how detached from the real world they are (no surprise it took them ages before accepting that something like CK's stuff would be helpful). Linux devs should find out how their operating systems are used some time. I suppose that's why most people use distros.

    It should pretty much be standard practice to mount filesystems noatime (and nodiratime,barrier=1 on ext3). Most sane distros have the noatime option even in their install GUI/UIs, it's not like some "new fangled" stuff like barrier=1 (which tries to make sure that data is actually flushed to nonvolatile storage on syncs, and not just the drive's volatile buffers).

    Heh, and to quote Ingo: "So for most file workloads we give Windows a 20%-30% performance edge, for almost nothing".

    Ingo even thinks they give Windows a performance advantage because of atime when Windows actually does something like atime. The few people who know how to set up windows systems (call them oxymorons if you want ;) ) disable atime on windows too:

    See: http://www.microsoft.com/technet/prodtechnol/windo ws2000serv/reskit/regentry/46656.mspx?mfr=true

    Search for NtfsDisableLastAccessUpdate for more.

    That said, reltime sounds vaguely interesting from an academic POV but there are bigger fish to fry. Most people who care about performance should just disable atime.

    Most apps including email should NOT use atime - at _worst_ they should use "modified time" (and even then use something else if possible). Atime is more for forensics not for apps (after all the app can't tell if it's some random user/app who tried to accessed the file, so what's the point?), and nowadays if someone's got unauthorized access to your system, whether you have atime on or not doesn't make a big difference at all.

    --
  63. If you use Maildir you wouldn't notice. by Kadin2048 · · Score: 1

    Odd. Been using mutt continuously for years on noatime mounted file systems. And it's been working errorlessly. What's supposed to be broken for me? It depends on how you are using it. If you use mutt with Maildirs for storage then it's irrelevant; there aren't any issues. (Maildir format keeps track of message status by shuffling them between folders, there's one folder for new mail and another for read mail, etc., so atime doesn't come into play for status.)

    The atime problem occurs when you use mutt with mbox-formatted stores, since it defaults (according to the Mutt wiki, anyway) to using atime in order to show whether there is new mail in a particular "folder." (A 'folder' in mbox format being, of course, a single flat file.) It doesn't use atime for message-specific status, only for the status of the overall mbox folder.

    There is apparently a compile-time option ("--buffy-size") that tells mutt to use the mbox's file size in lieu of atime, which is another alternative for noatime systems, although it seems like a bit of a hack to me.
    --
    "Ladies and gentlemen, my killbot features Lotus Notes and a machine gun. It is the finest available."
  64. a bit of the hair of the dog by Joseph_Daniel_Zukige · · Score: 1

    atime?

    That's not enough. In addition to atime and mtime, I think we need a real creation time stamp, as well. And a flag to show whether the current file was created ex-nihilo, by copying an existing file, or from an intentional template. Or by overwriting with a new version not immediately derived from the current one on the system.

    To help keep this making sense, the OS would, by default, want to implement edit-by-copy-and-rename instead of edit-in-place.

    A count of edits-from-creation could be interesting. It might be used to flag the difference between creation ex-nihilo and creation-by-copy, but then you would be back to not being able to tell the difference between an edit and a branch.

    Yeah, I think version control should be built into the OS for general use computers. It would sure help me keep all the cruft out of my backups.

    Metadata in the directory record might help reduce the overhead of tracking all that, but versioning definitely slows a system down.

    Of course, as many have already noted, many parts of the directory tree don't need to track atime, which is the worst burden. But it would sure be nice to be able to look at the metadata and have an idea, modulo deliberate or accidental manipulation of metadata, which files in the system directories were unaltered from the install of that version of the OS.

    Of course, while I can sit here and daydream, I can't be bothered to actually implement any of this.

    joudanzuki

  65. spin-up by hand? by Joseph_Daniel_Zukige · · Score: 2, Interesting

    Well, not exactly, but I got a used notebook drive. A year after I started using that notebook as my home web server, heat and centrifugal force and such seems to have spun the grease away from the contact surfaces of the bearings. Or, the disks may have been sleeping and restarting every ten minutes to run the dynamic dns client. (I really need to figure out how to keep that script and the perl it uses in a RAM disk or something.)

    Anyway, it started humming from the re-seeks caused by disks that couldn't maintain speed, and then eventually the disk froze.

    Thought I had lost the data.

    But I thought twice about it. If I just trashed the drive, the data was gone. I couldn't afford to send it in to a professional recovery service, and I did have backups that were sort of recent, anyway. And I wanted to show the insides of the drive to my son.

    So I opened the enclosure, showed it to my son but didn't let him touch it, rotated the disks by hand (very carefully avoiding touching or letting dust fall on the disk surfaces), closed it up, plugged it into a USB shirt-pocket enclosure, and pulled off my data.

    Turns out I can still use the drive to carry unimportant data around. (Very light use.) I don't trust critical data on it, of course.

    joudanzuki

  66. mtime? by DigiDarkCloud · · Score: 1

    Not all that useful? Have you ever tried to write a backup or sync script without it?

    I would have assumed mtime (file modification time) would be more useful for this purpose. There's no sense updating the backup of my entire music collection if the only "change" I've made is to listen to it.

    Of course, rsync is incredibly useful in this case, since it can transfer only the parts of my collection that have changed (ie, nothing). The man page is thin on technical details, though; specifically, whether it relies on atime or mtime or something else to do its work.

    --
    SIG: 11
    1. Re:mtime? by kamome · · Score: 1

      Just tried on a noatime fs - as expected, rsync works perfectly.

  67. OMG KITTIES!1 by Ceriel+Nosforit · · Score: 1

    I'm not sure your link is correct. I kinda like it though. :3
    --
    All rites reversed 2010
  68. Unfortunately, reading atime updates atime by Anonymous Coward · · Score: 0

    At least according to the POSIX spec. Because this is (as you can easily see) a bloody stupid thing to do, some systems don't do this and only update atime on open on file.

  69. "When did I install this driver"? by Anonymous Coward · · Score: 0

    "When did I do a ./configure"?
    "When did I recieve this file"?

  70. Why is atime still on by default? by Antique+Geekmeister · · Score: 1

    Seriously, atime is a performance hit and quite pointless except for a few legacy applications like mutt. It's amazingly bad for mail and news and web and build servers.

    Is there any reason not to simply turn it off for /, besides mutt?

    And to the people still thrilled by mutt and its use of easily parseable plain text files, seriously consider switching to a Maildir based system that provides the same unmodified email power, and doesn't have the historical limitations on maximum number of messages that mutt used to have and still may have.

  71. Btw by King+Gabey · · Score: 1

    Although from the thread they agree, Ingo != Linus

  72. This is exactly why I like IMAP by samael · · Score: 1

    I can get to my mail folders from a variety of places using a common standard...

  73. why a pointed stick? by hb253 · · Score: 1

    I don't get it, wouldn't you POKE or STAB someone with a pointed stick and BEAT them about the head with a (fish | club | stick | cat) etc?

    --
    Self awareness - try it!
    1. Re:why a pointed stick? by swordgeek · · Score: 1

      He's Finnish. There's no accounting for such behaviour.

      --

      "People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
  74. Off-Topic, but for the interested among you by Benanov · · Score: 1

    Can be done with a command line too:

    fsutil behavior set disablelastaccess 1
  75. Ingo, not Linus. by Anonymous Coward · · Score: 0

    FYI, Ingo said those words, not Linus.

  76. No, it's not evil at all by Anonymous Coward · · Score: 0

    If you have to update a file that could be used by other processes, one easy way to do that safely is to create a new file in the directory with a temporary name, unlink the original file, and rename the new file to the original name.

    If you don't do something like that, there's a possibility that a process could try to access the file as you're updating it and get inconsistent results.

    Just try and come up with a scheme for updating a simple file in an environment without mandatory file locking that doesn't involve something like that.

  77. Those chmod() calls are are necessary by Anonymous Coward · · Score: 0
    Well, indirectly, anyway.

    If you don't chmod() a file after creating it, you can't guarantee the permissions on the file will be exactly what you want unless you've cleared the umask. But since the umask is a process-wide attribute, if you muck with it you run the risk of affecting something else.

    In other words, it's easier and safer to write:

    fd = open( "/some/file/name", O_CREAT | O_RDWR | O_TRUNC, 0644 );
    fchmod( fd, 0644 );

    than it is to write:

    old_umask = umask( 0 );
    fd = open( "/some/file/name", O_CREAT | O_RDWR | O_TRUNC, 0644 );
    umask( old_umask );

    The latter can impact other threads running in the same process. And that open() call could block for a long time - imagine some HSM system where the file has to be recalled from tape before you can truncate it.
  78. So why is this a problem? by jc42 · · Score: 1

    Not trying to flame here, just a bit baffled by the problem ...

    Back when I first started learning unix, a few decades ago, one of the standard examples of its cleverness was the way that it did in-memory buffering of all files. This meant that any changes to a file (including the inode stuff like time stamps) never require a disk write. The block's "true" value is in the buffer, not on disk, and all accesses to the block by any process will read the buffer, and thus see the true value. Writes are only needed when buffer space is full and some blocks need to be flushed to disk. And especially clever were the "disk strategy" routines that did read-ahead, making most reads instantaneous because the data was already sitting in a kernel buffer.

    The (f)sync system calls are there explicitly to handle the obvious problem: In case of a power failure or other system crash, everything in the in-memory buffers is lost. Competent programmers are aware of this, and don't trust whatever heuristics the kernel might have for flushing the buffers to disk; you call fsync occasionally for data that you don't want lost in a power failure. Otherwise, you assume that the info is kept in memory, and the info on disk may be out of date. Having files buffered for hours or days is an old unix "problem", often solved by running a background task that calls sync once an hour.

    Does this atime problem mean that linux systems actually flush every buffer after every change? If so, that's a blatant violations of the original unix design. Yeah, I know it's safer when there are system crashes. But the buffer design was put there for a very good reason: In a lot of situations, speed is more important than providing survival past a power failure. And for many files (e.g., those in /tmp), there's no need at all for the data to survive the process's death; flushing its data to disk is a total waste of time, to be avoided when possible.

    On almost all systems, a simple strategy can be used. For example, the kernel can flush buffers slowly on a cyclical basis, partly dependent on cpu load. You probably also want to flush any buffers for a file that has just been closed by a writer. There are lots of strategies that don't impose a measurable load on the system.

    But flushing the inode after every read is just dumb. Why would anyone ever configure a kernel that way? What were they thinking?

    Really, I'm not being insulting; I'm baffled by why anyone would do this. Is there some situation where you want this done? Or was it just overkill of a hypothetical problem that in practice isn't a problem?

    --
    Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    1. Re:So why is this a problem? by spitzak · · Score: 1

      Yes, the atime updates are stored in buffers and only flushed to disk on a sync and during idle and otherwise when it gets around to it, just like any other data.

      However they still need to be written some time, and even storing the fact that it needs to be written takes time and space. If a program kept writing different data to a file for no reason and that data was never used, it would certainly be obvious that removing the writing of that file would improve performance, even though that data is buffered.

    2. Re:So why is this a problem? by jc42 · · Score: 1

      Yes, the atime updates are stored in buffers and only flushed to disk on a sync and during idle and otherwise when it gets around to it, just like any other data.

      Actually, there is only one atime field per file, and it's in the inode block. A read shouldn't change any bits in any other buffers. I'd expect the inode block to be written only at a (f)sync or on close, so it should take some quite unusual circumstances for this to be a significant (or even measurable) load on most systems. The only way this could be significant is if most processes are busily opening files for reading and immediately closing them. While I could certainly create a test case for this, I doubt that it has ever happened on any unix system that I've worked on. So I still consider the issue a red herring, and ask why it's even an issue.

      If a program kept writing different data to a file for no reason and that data was never used, it would certainly be obvious that removing the writing of that file would improve performance, even though that data is buffered.

      True, but that would be changing the mtime field, not the atime field. The article was explicitly about disk writes triggered by changes to the atime field, which doesn't happen on data writes.

      Without (f)sync calls, I'd expect that most unix-like systems should do relatively few writes in such a scenario. The typical disk strategy routines use some variant of a LRU (least recently used) heuristic to decide which buffers to free. A freed buffer marked modified would be written, of course. But a program with the above behavior would tend to have most of its buffers marked as recently used, so they wouldn't be chosen by the buffer-freeing routine, and they wouldn't be flushed. There are cyclical buffer-freeing strategies, of course, and such programs would cause buffer flushing in such systems.

      In any case, such writes are off topic, because we're talking about disk writes triggered by changes to the atime fields in files' inode blocks.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
  79. ADDENDUM TO MY LAST POST! by Anonymous Coward · · Score: 0

    ADDENDUM:

    To my last post on this subject, here -> http://linux.slashdot.org/comments.pl?sid=264507&c id=20169817

    (The post above this one, it's parent, etc.)

    One OTHER place, that MIGHT be affected, POSSIBLY, & I WOULD LIKE FEEDBACK ON THIS IF POSSIBLE?

    Modern defraggers & also, the most modern versions of Windows' "prefetch" features!

    (IIRC, since WinXP, into Server 2003, & VISTA (not SURE about 2000, iirc, it does NOT have this (been a LONG TIME since I ran 2000 is why I am no longer sure) this helps performance, in THEORY!

    Thus - & THIS, I have always wondered about:

    QUESTION:

    NOW - IF the file access timestamp is NOT applied on NTFS using filesystems? Do the modern features mentioned (last filetime access) actually UPDATE & ALLOW Windows "prefetch" & modern defraggers like Raxco PerfectDisk, Executive Software's Diskeeper, & YES - even the NATIVE defragger in Windows XP/Server 2003, & VISTA, to GAIN PERFORMANCE BY PLACING MOST RECENTLY or rather, MOST USED files closer to the outermost, fastest tracks of the HDD?

    Thanks for the answer here, & YOUR TAKE ON IT!

    A particular file, being accessed recently is NOT enough, but moreso, how OFTEN it gets accessed (if daily, everyday, & a lot? Move it up to the faster areas of the disk, especially executables more than data files, but doing it to data files might not hurt either, especially "init" files, like the registry for instance)...

    Thus, turning this ON (stopping NTFS filesystem last access of a file updating its timestamp in MFT$ for that)? I think it does NOT hurt defraggers... it's more the amounts of time, over a LONG PERIOD, that matter here...

    E.G. #1-> I access a file, TODAY ONLY, & reboot... but, I never access that file again for WEEKS/MONTHS/YEARS? What was the point of moving it up to a faster area of the diskdrive for??

    E.G. #2-> HOWEVER, on the converse, I accessa a file, TODAY AND ALL THIS YEAR, & reboot... Moving it forward HAS benefits, since the outermost tracks of a drive ARE FASTER!

    (In other words, I believe that the datestamp of last access alone, is NOT enough & not ALL the "Prefetch" features of XP/Server2k3/VISTA use, but also how OFTEN this occurs & how often you access a file over a LONG period!)

    APK

    P.S.=> IIRC, I believe the "placement of most used files near the outermost fastest tracks of a harddisk drive (HDD)" actually came from INTEL's pioneering the idea... then again, you have the theory that placement of many files, mid-disk, allows binary searches to work faster (as they always 'cut' the entire dataset in 1/2, & search midpoint lesserthan OR greaterthan etc. for a sought item (mathematically, that is))... apk

  80. Re:ADDENDUM TO MY ADDENDUM:Correction (minor) by Anonymous Coward · · Score: 0

    ADDENDUM/CORRECTION (to my first addendum) in my last post, which was an addendum to my first one (lol, sorry), here:

    http://linux.slashdot.org/comments.pl?sid=264507&c id=20170011

    " then again, you have the theory that placement of many files, mid-disk, allows binary searches to work faster (as they always 'cut' the entire dataset in 1/2, & search midpoint lesserthan OR greaterthan etc. for a sought item (mathematically, that is))... apk"

    Change that "middisk", to "midpoint of filedata on disk"

    AGAIN = NOT MID DISK, but middle of the files placed ON THE DISK (the actual searched area, the filemass, NOT the 'empty space')

    That's for the binary search method that NTFS actually uses during seeks, to work for better performance!

    APK

    P.S.=> "The devils really ARE in the details", on this one, & I don't wish to misinform anyone, OR miss putting my point across, with correct details backing it... apk

  81. Re:ADDENDUM TO MY ADDENDUM:Correction (minor) by Nimey · · Score: 1

    Are you Steve Gibson? You write sort of like he does.

    --
    Hail Eris, full of mischief...

    E pluribus sanguinem
  82. Re:ADDENDUM TO MY ADDENDUM:Correction (minor) by Anonymous Coward · · Score: 0

    No, sorry... I am not he, though I know who he is.

    APK

  83. Information management anyone? by master_p · · Score: 1

    The whole discussion above clearly shows a domain when modern operating systems have failed: information management. Living the definition of information to the applications creates the kinds of problems discussed above.

    The solution is the following: Operating systems should define a mechanism for defining information types, including conceptual and physical details.

    In other words, O/Ses should provide, by default, not a filesystem, but a database. If Unix came with a database by default, no such problems like the above would exist.

    1. Re:Information management anyone? by adrianbaugh · · Score: 1

      YA Hans Reiser AICMFP :-)

      --
      "'I pass the test,' she said. 'I will diminish, and go into the West, and remain Galadriel.'"
      - JRR Tolkien.
    2. Re:Information management anyone? by hab136 · · Score: 1

      The whole discussion above clearly shows a domain when modern operating systems have failed: information management. Living the definition of information to the applications creates the kinds of problems discussed above.

      The solution is the following: Operating systems should define a mechanism for defining information types, including conceptual and physical details.

      In other words, O/Ses should provide, by default, not a filesystem, but a database. If Unix came with a database by default, no such problems like the above would exist.

      Hans Reiser argues much the same - that file systems should basically be usable as databases - and also explains why they previously have not been (such as 512-byte minimum allocation structures). BeOS had a database filesystem, strong metadata on files and strong typing of files (example: MP3 files had their ID3 tags in the resource fork), but it failed as a commercial product.

      One problem with the OS defining file data structure is that all progress then depends on the OS. The first time an application needs to do something that wasn't anticipated by the OS, they're going to make their own structure and pack it into the existing structure - and you're back at square one.
  84. What cave has he been living in? by Quixadhal · · Score: 1

    We used the noatime option for mounting our disks many years ago, not so much for the performance gain (which IS measurable in an I/O heavy system), but for the stability. Not having the disk writing every time a read-only query is done in your database of millions of rows means, well, no disk is being written to most of the time. Hence, a power failure that lasts longer than your UPS isn't likely to cause any nasty database corruption.

    Those who like access times for security reasons probably really want a full audit log that shows every instance of the access AND which UID did it.

  85. How about once-a-day update to atime? by Rob+Y. · · Score: 1

    It ought to be easy to check whether the current atime is for today and limit the atime updates to one write per day per file. That would provide most of the info provided by atime and eliminate most of the overhead, no?

    --
    Posted from my Android phone. Oh, I can change this? There, that's better...
    1. Re:How about once-a-day update to atime? by drachenstern · · Score: 1

      wouldn't it then be beneficial to rename this new method to aday or adate? also, you now have to construct huge lists of references in ram, that cannot be cached or you somewhat defeat the purpose, that are only to process the files for the past 24 hours at the most, and what about a server that does some sort of obscene logging system, so that it creates new logs or updates logs by the thousand per hour? maybe some sort of mass cvs compiler system or something? I think you get the idea.

      While it would work for a few systems to speed things up, think of all the files that get "written to" when you browse the web using a "standard" system (ie, no adblockplus or similar). The pointer list has the potential to grow quite large, not to mention that that's one more thing that the kernel has to keep track of, or at least the i/o subsys.

      And you have to maintain it per mount, so what if you mounted a cdrw or iso vs a cd or cdr (ignoring here completely the redundancy of questioning about dvd families or floppies or whatever)? Technically those are rewritable systems with atime capable tracking, so do you do adate on those as well? what about when the system craters, now all of your security tracking is lost.

      I guess my point is that it's sort of an all or nothing thing here, although this is my take.

      --
      2^3 * 31 * 647
    2. Re:How about once-a-day update to atime? by MSG · · Score: 1

      What the hell are you talking about? "lists of references"?

      The relatime proposal checks atime/mtime/ctime when files are read, and only updates atime if 1) atime MAX(mtime,ctime), or 2) atime is more than one day old (or some other interval). No lists of references are required.

  86. Can you turn off atime... by BigAssRat · · Score: 1

    (equivalent) in Windows? The only thing I have found checking the access time on a file is as an alternative to the Now() function.

  87. relatime: Cool! by dwheeler · · Score: 1
    I like the idea of relatime.

    I actually _use_ atime values, directly.... because sometimes I really do want to know when something was last accessed. This is as a human, not a program, so saying "well fix the program" isn't helpful. And it's been built into Unix from the beginning, so it's not like it's some amazing new capability. But I agree that I typically don't need fine-grained knowledge of when something was last used; I'm usually looking to see what is old cruft, etc. Some programs only need "was it accessed after modification", and certainly there's a performance hit for atime. So this "relatime" looks great to me.... I get my "cruft" information, and existing programs work, without the performance hit of traditional atime. As long as there's a WAY to force the traditional atime to be supported (via some mount-time option), I think relatime (even as a default) is a reasonable compromise. Relatime gives higher performance in exchange for a poorer quanta on atime, and for many, that's probably a worthy trade.

    I like the idea of writing the "more accurate" atime when it's "for free". I don't see the big advantage of ALWAYS being a day late... I think it's better to say "at worse, it's a day late, but it MIGHT be better".

    --
    - David A. Wheeler (see my Secure Programming HOWTO)
  88. Suggested improvement by Froggie · · Score: 1

    I agree the whole atime thing is bollocks, but you can improve efficiency while keeping the semantics - cache atime updates in one place.

    The issue is the need to keep in memory a dirty copy of every inode block with updated atimes (and there are lots of inode blocks, and you have open a few files from all over the disk, so worst case you're maintaining 1 block per open file), and write them every 30s or however often.

    If, instead, you kept an atime cache of (inode number, atime) which (if an entry was present) overrode the entry in the basic inode, then you could just update this cache and write its (2 or 3) blocks out to disk. You can propagate the changes to the inode atime once the file's been closed a while (and then reuse the entry in the cache, keeping its size down). You might also decide that writing the atime cache is very low urgency and only do it when other disk changes are made.

    A quick off the cuff calculation suggests that a 4k block would hold 512 files worth of this information. I don't know how many open files there are on a machine at once, but on a desktop-usage one, I suspect it's less than a couple of thousand most of the time.

    The risk is the effect it might have on fast path code for inode lookups. You'd be adding a hash table lookup for every inode fetch.

  89. Well by Rob+Simpson · · Score: 1

    It's a heck of a lot easier than trying to partition the drive when the menu only gives you the option to either wipe the entire disk or manually install. It's also a lot easier to understand than stuff like getting my SD card reader to work.

  90. Gentoo Default by The+Raven · · Score: 1

    A standard Gentoo install turns off atime by default. It's been that way for at least five years, perhaps longer.

    --
    "I will trust Google to 'do no evil' until the founders no longer run it." Hello Alphabet.