From 3c0403f1cb42bb5150c57e8f63bfbc03ebe4e4fd Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 25 Jan 2015 22:23:04 -0500 Subject: [PATCH] Update lazytime patches (plus one change post -v8) --- cover-letter | 19 ++++++++++++++----- ext4-add-lazytime-mount-option | 30 +++++++++++------------------- vfs-add-lazytime-mount-option | 22 +++++++++++----------- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/cover-letter b/cover-letter index 0cafa9e5..3bd9beda 100644 --- a/cover-letter +++ b/cover-letter @@ -1,4 +1,4 @@ -Subject: [PATCH-v7 0/3] add support for a lazytime mount option +Subject: [PATCH-v9 0/3] add support for a lazytime mount option This is an updated version of what had originally been an ext4-specific patch which significantly improves performance by lazily @@ -34,9 +34,15 @@ helpful: You can also see how many lazytime inodes are in memory by looking in /sys/kernel/debug/bdi//stats -Changes since -v7: (not yet released) +Changes since -v8: (not yet released) + - in ext4_update_other_inodes_time() clear I_DIRTY_TIME_EXPIRED as + well as I_DIRTY_TIME + +Changes since -v7: - Fix comment typos - - Clear the I_DIRTY_TIME flag if I_DIRTY_INODE gets added + - Clear the I_DIRTY_TIME flag if I_DIRTY_INODE gets added in + __mark_inode_dirty() + - Fix a bug accidentally introduced in -v7 which broke lazytime altogether Changes since -v6: - Add a new tracepoint writeback_dirty_inode_enqueue @@ -112,7 +118,7 @@ Theodore Ts'o (3): fs/ext4/inode.c | 71 ++++++++++++++++++++++++-- fs/ext4/super.c | 10 ++++ - fs/fs-writeback.c | 64 ++++++++++++++++++----- + fs/fs-writeback.c | 62 +++++++++++++++++++---- fs/gfs2/file.c | 4 +- fs/inode.c | 106 +++++++++++++++++++++++++++++++++------ fs/jfs/file.c | 2 +- @@ -125,4 +131,7 @@ Theodore Ts'o (3): include/trace/events/writeback.h | 60 +++++++++++++++++++++- include/uapi/linux/fs.h | 4 +- mm/backing-dev.c | 10 +++- - 15 files changed, 344 insertions(+), 39 deletions(-) + 15 files changed, 343 insertions(+), 38 deletions(-) + +-- +2.1.0 diff --git a/ext4-add-lazytime-mount-option b/ext4-add-lazytime-mount-option index 49fd1029..1b15788c 100644 --- a/ext4-add-lazytime-mount-option +++ b/ext4-add-lazytime-mount-option @@ -14,13 +14,13 @@ Google-Bug-Id: 18297052 Signed-off-by: Theodore Ts'o --- - fs/ext4/inode.c | 65 +++++++++++++++++++++++++++++++++++++++++++++--- + fs/ext4/inode.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++-- fs/ext4/super.c | 10 ++++++++ - include/trace/events/ext4.h | 30 ++++++++++++++++++++++ - 3 files changed, 102 insertions(+), 3 deletions(-) + include/trace/events/ext4.h | 30 ++++++++++++++++++++++++ + 3 files changed, 102 insertions(+), 2 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c -index 5653fa4..6327b28 100644 +index 628df5b..9193ea1 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -4139,6 +4139,65 @@ static int ext4_inode_blocks_set(handle_t *handle, @@ -48,7 +48,7 @@ index 5653fa4..6327b28 100644 + (inode->i_state & I_DIRTY_TIME)) { + struct ext4_inode_info *ei = EXT4_I(inode); + -+ inode->i_state &= ~I_DIRTY_TIME; ++ inode->i_state &= ~(I_DIRTY_TIME | I_DIRTY_TIME_EXPIRED); + spin_unlock(&inode->i_lock); + + spin_lock(&ei->i_raw_lock); @@ -89,15 +89,7 @@ index 5653fa4..6327b28 100644 /* * Post the struct inode info into an on-disk inode location in the * buffer-cache. This gobbles the caller's reference to the -@@ -4237,7 +4296,6 @@ static int ext4_do_update_inode(handle_t *handle, - for (block = 0; block < EXT4_N_BLOCKS; block++) - raw_inode->i_block[block] = ei->i_data[block]; - } -- - if (likely(!test_opt2(inode->i_sb, HURD_COMPAT))) { - raw_inode->i_disk_version = cpu_to_le32(inode->i_version); - if (ei->i_extra_isize) { -@@ -4248,10 +4306,11 @@ static int ext4_do_update_inode(handle_t *handle, +@@ -4248,10 +4307,11 @@ static int ext4_do_update_inode(handle_t *handle, cpu_to_le16(ei->i_extra_isize); } } @@ -112,10 +104,10 @@ index 5653fa4..6327b28 100644 BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata"); rc = ext4_handle_dirty_metadata(handle, NULL, bh); diff --git a/fs/ext4/super.c b/fs/ext4/super.c -index 58859bc..5310ec9 100644 +index 74c5f53..362b23c 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c -@@ -1132,6 +1132,7 @@ enum { +@@ -1139,6 +1139,7 @@ enum { Opt_noquota, Opt_barrier, Opt_nobarrier, Opt_err, Opt_usrquota, Opt_grpquota, Opt_i_version, Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, @@ -123,7 +115,7 @@ index 58859bc..5310ec9 100644 Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, Opt_inode_readahead_blks, Opt_journal_ioprio, Opt_dioread_nolock, Opt_dioread_lock, -@@ -1195,6 +1196,8 @@ static const match_table_t tokens = { +@@ -1202,6 +1203,8 @@ static const match_table_t tokens = { {Opt_i_version, "i_version"}, {Opt_stripe, "stripe=%u"}, {Opt_delalloc, "delalloc"}, @@ -132,7 +124,7 @@ index 58859bc..5310ec9 100644 {Opt_nodelalloc, "nodelalloc"}, {Opt_removed, "mblk_io_submit"}, {Opt_removed, "nomblk_io_submit"}, -@@ -1452,6 +1455,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, +@@ -1459,6 +1462,12 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token, case Opt_i_version: sb->s_flags |= MS_I_VERSION; return 1; @@ -145,7 +137,7 @@ index 58859bc..5310ec9 100644 } for (m = ext4_mount_opts; m->token != Opt_err; m++) -@@ -5013,6 +5022,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) +@@ -5020,6 +5029,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data) } #endif diff --git a/vfs-add-lazytime-mount-option b/vfs-add-lazytime-mount-option index 8b54a999..72b58cf5 100644 --- a/vfs-add-lazytime-mount-option +++ b/vfs-add-lazytime-mount-option @@ -23,19 +23,19 @@ Google-Bug-Id: 18297052 Signed-off-by: Theodore Ts'o --- - fs/ext4/inode.c | 6 ++++++ - fs/fs-writeback.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++---------- - fs/gfs2/file.c | 4 ++-- - fs/inode.c | 56 +++++++++++++++++++++++++++++++++++--------------- + fs/ext4/inode.c | 6 +++++ + fs/fs-writeback.c | 62 ++++++++++++++++++++++++++++++++++++++-------- + fs/gfs2/file.c | 4 +-- + fs/inode.c | 56 +++++++++++++++++++++++++++++------------ fs/jfs/file.c | 2 +- fs/libfs.c | 2 +- fs/proc_namespace.c | 1 + - fs/sync.c | 8 ++++++++ + fs/sync.c | 8 ++++++ include/linux/backing-dev.h | 1 + - include/linux/fs.h | 5 +++++ - include/trace/events/writeback.h | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++- - include/uapi/linux/fs.h | 4 +++- - mm/backing-dev.c | 10 +++++++-- + include/linux/fs.h | 5 ++++ + include/trace/events/writeback.h | 60 +++++++++++++++++++++++++++++++++++++++++++- + include/uapi/linux/fs.h | 4 ++- + mm/backing-dev.c | 10 ++++++-- 13 files changed, 186 insertions(+), 35 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c @@ -61,7 +61,7 @@ index 5653fa4..628df5b 100644 if (IS_ERR(handle)) goto out; diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c -index 2d609a5..0046861 100644 +index 2d609a5..82c2984 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c @@ -247,14 +247,19 @@ static bool inode_dirtied_after(struct inode *inode, unsigned long t) @@ -211,9 +211,9 @@ index 2d609a5..0046861 100644 trace_writeback_dirty_inode(inode, flags); } ++ dirtytime = flags & I_DIRTY_TIME; + if (flags & I_DIRTY_INODE) + flags &= ~I_DIRTY_TIME; -+ dirtytime = flags & I_DIRTY_TIME; /* * Paired with smp_mb() in __writeback_single_inode() for the -- 2.11.4.GIT