lazytime -v7 patches
[ext4-patch-queue.git] / cover-letter
blob44e8df32a2cc4713481909fe22ee7aa40e7a1d67
1 Subject: [PATCH-v7 0/3] add support for a lazytime mount option
3 This is an updated version of what had originally been an
4 ext4-specific patch which significantly improves performance by lazily
5 writing timestamp updates (and in particular, mtime updates) to disk.
6 The in-memory timestamps are always correct, but they are only written
7 to disk when required for correctness.
9 This provides a huge performance boost for ext4 due to how it handles
10 journalling, but it's valuable for all file systems running on flash
11 storage or drive-managed SMR disks by reducing the metadata write
12 load.  So upon request, I've moved the functionality to the VFS layer.
13 Once the /sbin/mount program adds support for MS_LAZYTIME, all file
14 systems should be able to benefit from this optimization.
16 There is still an ext4-specific optimization, which may be applicable
17 for other file systems which store more than one inode in a block, but
18 it will require file system specific code.  It is purely optional,
19 however.
21 For people interested seeing how timestamp updates are held back, the
22 following example commands to enable the tracepoints debugging may be
23 helpful:
25   mount -o remount,lazytime /
26   cd /sys/kernel/debug/tracing
27   echo 1 > events/writeback/writeback_lazytime/enable
28   echo 1 > events/writeback/writeback_lazytime_iput/enable
29   echo "state & 2048" > events/writeback/writeback_dirty_inode_enqueue/filter
30   echo 1 > events/writeback/writeback_dirty_inode_enqueue/enable
31   echo 1 > events/ext4/ext4_other_inode_update_time/enable
32   cat trace_pipe
34 You can also see how many lazytime inodes are in memory by looking in
35 /sys/kernel/debug/bdi/<bdi>/stats
37 Changes since -v6:
38    - Add a new tracepoint writeback_dirty_inode_enqueue
39    - Move generic handling of update_time() to generic_update_time(),
40      so filesystems can more easily hook or modify update_time()
41    - The file system's dirty_inode() will now always get called with
42      I_DIRTY_TIME when the inode time is updated.   (I_DIRTY_SYNC will
43      also be set if the inode should be updated right away.)   This allows
44      file systems such as XFS to update its on-disk copy of the inode if
45      I_DIRTY_TIME is set.
47 Changes since -v5:
48    - Tweak move_expired_inodes to handle sync() and syncfs(), and drop
49      flush_sb_dirty_time().
50    - Move logic for handling the b_dirty_time list into
51      __mark_inode_dirty().
52    - Move I_DIRTY back to its original definition, and use I_DIRTY_ALL
53      for I_DIRTY plus I_DIRTY_TIME.
54    - Fold some patches together to make the first patch easier to
55      review (and modify/update).
56    - Use the pre-existing writeback tracepoints instead of creating a new
57      fs tracepoints.
59 Changes since -v4:
60    - Fix ext4 optimization so it does not need to increment (and more
61      problematically, decrement) the inode reference count
62    - Per Christoph's suggestion, drop support for btrfs and xfs for now,
63      issues with how btrfs and xfs handle dirty inode tracking.  We can add
64      btrfs and xfs support back later or at the end of this series if we
65      want to revisit this decision.
66    - Miscellaneous cleanups
68 Changes since -v3:
69    - inodes with I_DIRTY_TIME set are placed on a new bdi list,
70         b_dirty_time.  This allows filesystem-level syncs to more
71         easily iterate over those inodes that need to have their
72         timestamps written to disk.
73    - dirty timestamps will be written out asynchronously on the final
74         iput, instead of when the inode gets evicted.
75    - separate the definition of the new function
76         find_active_inode_nowait() to a separate patch
77    - create separate flag masks: I_DIRTY_WB and I_DIRTY_INODE, which
78        indicate whether the inode needs to be on the write back lists,
79        or whether the inode itself is dirty, while I_DIRTY means any one
80        of the inode dirty flags are set.  This simplifies the fs
81        writeback logic which needs to test for different combinations of
82        the inode dirty flags in different places.
84 Changes since -v2:
85    - If update_time() updates i_version, it will not use lazytime (i..e,
86        the inode will be marked dirty so the change will be persisted on to
87        disk sooner rather than later).  Yes, this eliminates the
88        benefits of lazytime if the user is experting the file system via
89        NFSv4.  Sad, but NFS's requirements seem to mandate this.
90    - Fix time wrapping bug 49 days after the system boots (on a system
91         with a 32-bit jiffies).   Use get_monotonic_boottime() instead.
92    - Clean up type warning in include/tracing/ext4.h
93    - Added explicit parenthesis for stylistic reasons    
94    - Added an is_readonly() inode operations method so btrfs doesn't
95        have to duplicate code in update_time().
97 Changes since -v1:
98    - Added explanatory comments in update_time() regarding i_ts_dirty_days
99    - Fix type used for days_since_boot
100    - Improve SMP scalability in update_time and ext4_update_other_inodes_time
101    - Added tracepoints to help test and characterize how often and under
102          what circumstances inodes have their timestamps lazily updated
104 Theodore Ts'o (3):
105   vfs: add support for a lazytime mount option
106   vfs: add find_inode_nowait() function
107   ext4: add optimization for the lazytime mount option
109  fs/ext4/inode.c                  |  71 ++++++++++++++++++++++++--
110  fs/ext4/super.c                  |  10 ++++
111  fs/fs-writeback.c                |  64 ++++++++++++++++++-----
112  fs/gfs2/file.c                   |   4 +-
113  fs/inode.c                       | 106 +++++++++++++++++++++++++++++++++------
114  fs/jfs/file.c                    |   2 +-
115  fs/libfs.c                       |   2 +-
116  fs/proc_namespace.c              |   1 +
117  fs/sync.c                        |   8 +++
118  include/linux/backing-dev.h      |   1 +
119  include/linux/fs.h               |  10 ++++
120  include/trace/events/ext4.h      |  30 +++++++++++
121  include/trace/events/writeback.h |  60 +++++++++++++++++++++-
122  include/uapi/linux/fs.h          |   4 +-
123  mm/backing-dev.c                 |  10 +++-
124  15 files changed, 344 insertions(+), 39 deletions(-)