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.

3 Comments

  • basketball slam dunk Reply

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

  • happy wheels Reply

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

  • élagueur Reply

    It’s too horrible just to think about it.

    For now that is true.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.