Kernel 4.0: lazytime

With lazytime, the Linux Kernel 4.0 brings a new feature which lazy updates the file timestamps on the disk.

 File access timestamps

Basically all UNIX filesystems keep track of file access and modify informations. This is a nice thing, but on heavy-load systems with a lot of I/O it can be very expensive to continuously keep track of access timestamps . Therefor there was the noatime mount option which didn’t update the access timestamp at all. Then there was also the relatime mount option, which was a compromise between atime and relatime (see the earlier blog post for a detailed description).

However these existing mount options might not fit all use cases, especially if you’re looking on a heavy-load I/O system where current access timestamps are required.

lazytime – the new mount option

The lazy update feature of the 4.0 Kernel can be enabled via lazytime mount option. It targets heavy-load I/O systems where timestamps are required on short-notice. On filesystems with an active lazytime mount option, the Kernel will keep track of timestamps like in case of atime. On the contrary, however, all timestamps updates will only be made in cache. Timestamps hold in cache will later be flushed to disk if one of the following events occur:

  • the inode needs to be updated anyway for some non-timestamp related changes
  • fsync(), syncfs() or sync() are called
  • an undeleted inode is evicted from memory

If you want to know more about the lazytime mount option, we recommend you read the LWN.net – Introducing lazytime article.

11 Comments

  • basketball slam dunk

    On the contrary, however, all timestamps updates will only be made in cache.

  • happy wheels

    Your share is the great knowledge I have gathered, you are an important person I admire, thank you

  • élagueur

    It’s too horrible just to think about it.

    For now that is true.

  • desmoinespainters.com

    “Basically all UNIX filesystems keep track of file access and modify informations”. Wow I didn’t know this information before, thank you for mentioning it here!

  • Business Listings

    I used this before and it was really helpful back then! I am so thankful when I found this site and I’m glad that this site is still up until now!

  • béton surface

    Thanks everyone for your participation.

  • doula

    Can you tell me a little more, please?