]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - fs/proc_namespace.c
vfs: add support for a lazytime mount option
authorTheodore Ts'o <tytso@mit.edu>
Mon, 2 Feb 2015 05:37:00 +0000 (00:37 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 5 Feb 2015 07:45:00 +0000 (02:45 -0500)
commit0ae45f63d4ef8d8eeec49c7d8b44a1775fff13e8
tree660dbb014482092361eab263847fb906b5a9ec22
parente36f014edff70fc02b3d3d79cead1d58f289332e
vfs: add support for a lazytime mount option

Add a new mount option which enables a new "lazytime" mode.  This mode
causes atime, mtime, and ctime updates to only be made to the
in-memory version of the inode.  The on-disk times will only get
updated when (a) if the inode needs to be updated for some non-time
related change, (b) if userspace calls fsync(), syncfs() or sync(), or
(c) just before an undeleted inode is evicted from memory.

This is OK according to POSIX because there are no guarantees after a
crash unless userspace explicitly requests via a fsync(2) call.

For workloads which feature a large number of random write to a
preallocated file, the lazytime mount option significantly reduces
writes to the inode table.  The repeated 4k writes to a single block
will result in undesirable stress on flash devices and SMR disk
drives.  Even on conventional HDD's, the repeated writes to the inode
table block will trigger Adjacent Track Interference (ATI) remediation
latencies, which very negatively impact long tail latencies --- which
is a very big deal for web serving tiers (for example).

Google-Bug-Id: 18297052

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
13 files changed:
fs/ext4/inode.c
fs/fs-writeback.c
fs/gfs2/file.c
fs/inode.c
fs/jfs/file.c
fs/libfs.c
fs/proc_namespace.c
fs/sync.c
include/linux/backing-dev.h
include/linux/fs.h
include/trace/events/writeback.h
include/uapi/linux/fs.h
mm/backing-dev.c