]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
vfs: add O_NOCMTIME historic/wip-o-nomtime
authorZach Brown <zab@zabbo.net>
Fri, 15 May 2015 21:23:48 +0000 (14:23 -0700)
committerSage Weil <sage@redhat.com>
Tue, 11 Aug 2015 20:12:49 +0000 (16:12 -0400)
commit0313954737ba5c5d5c92d21b8b603bc8b5b2f3c3
tree503482729e6f9bc4a7a41f7dd7d82c89d3753567
parent57afb87224d7ff5426da80dad9b1b0bd3859b7d4
vfs: add O_NOCMTIME

Add a O_NOCMTIME flag which prevents inode time updates on writes and
can greatly reduce the IO overhead of writes to allocated and
initialized regions of files.

ceph servers can have loads where they perform O_DIRECT overwrites of
allocated file data and then sync to make sure that the O_DIRECT writes
are flushed from write caches.  If the writes dirty the inode with mtime
updates then the syncs also write out the metadata needed to track the
inodes which can add significant iop and latency overhead.

The ceph servers don't use mtime at all.  They're using the local file
system as a backing store and any backups would be driven by their upper
level ceph metadata.

In simple tests a O_DIRECT|O_NOCMTIME overwriting write followed by a
sync went from 2 serial write round trips to 1 in XFS and from 4 serial
IO round trips to 1 in ext4.

file_update_time() is changed to call a file_is_nocmtime() helper which
tests the file flag in addition to testing the inode's S_NOCMTIME flag.
It doesn't check FMODE_NOCMTIME because that's only used by XFS to
trigger private flags which trigger private flags which do other things.

O_NOCMTIME can only be used if the mount has its MNT_NOCMTIME flag set.
This requires priviledged intervention to testify that mtime isn't
critical to, say, backup infrastructure or NFS server consistency
guarantees.

Signed-off-by: Zach Brown <zab@zabbo.net>
fs/fcntl.c
fs/inode.c
fs/namei.c
include/linux/fs.h
include/uapi/asm-generic/fcntl.h