All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] do not use s_dirt in ext4
@ 2012-04-02 11:45 Artem Bityutskiy
  2012-04-02 11:45 ` [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty Artem Bityutskiy
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-02 11:45 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

This patch-set makes ext4 independent of the VFS superblock management
services. Namely, ext4 does not require to register the 'write_super()' VFS
call-back.

The reason of this exercises is to get rid of the 'sync_supers()' kernel thread
which wakes up every 5 seconds (by default) even if all superblocks are clean.
This is wasteful from power management POW (unnecessary wake-ups).

Version 1 of this patch-set can be found here:
https://lkml.org/lkml/2012/3/20/220

Changes between v1 and v2.
  * Rake different strategy - instead of pushing 's_dirt' down "as-is" and
    emulating old behavior, we now just submit the superblock for writing
    straight away, either via the journal or directly. Thank to Jan Kara
    for helping with this.
  * Ted picked some of the patches already, which made this series shorter
    - thanks!
  * This time I've tested the changes using xfstests.
  * Rebased to 3.4-rc1.

Note: Ted, you merged the "mm: export dirty_writeback_interval", but it looks
like we won't need this for ext[23]. However, for other file-systems we will
need this change.

Thanks,
Artem.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-04-02 11:45 [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
@ 2012-04-02 11:45 ` Artem Bityutskiy
  2012-04-12  7:20   ` Artem Bityutskiy
  2012-04-02 11:45 ` [PATCH v2 2/4] ext4: Convert last user of ext4_mark_super_dirty() to ext4_handle_dirty_super() Artem Bityutskiy
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-02 11:45 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

From: Jan Kara <jack@suse.cz>

Commit a0375156 properly notes that superblock doesn't need to be marked
as dirty when only number of free inodes / blocks / number of directories
changes since that is recomputed on each mount anyway. However that comment
leaves some unnecessary markings as dirty in place. Remove these.

Artem: tested using xfstests for both journalled and non-journalled ext4.

Signed-off-by: Jan Kara <jack@suse.cz>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ext4/ialloc.c  |    2 --
 fs/ext4/mballoc.c |    2 --
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 409c2ee..b7188c6 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -295,7 +295,6 @@ out:
 		err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
 		if (!fatal)
 			fatal = err;
-		ext4_mark_super_dirty(sb);
 	} else
 		ext4_error(sb, "bit already cleared for inode %lu", ino);
 
@@ -800,7 +799,6 @@ got:
 	percpu_counter_dec(&sbi->s_freeinodes_counter);
 	if (S_ISDIR(mode))
 		percpu_counter_inc(&sbi->s_dirs_counter);
-	ext4_mark_super_dirty(sb);
 
 	if (sbi->s_log_groups_per_flex) {
 		flex_group = ext4_flex_group(sbi, group);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 99ab428..3db3dfc 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2822,7 +2822,6 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
 	err = ext4_handle_dirty_metadata(handle, NULL, gdp_bh);
 
 out_err:
-	ext4_mark_super_dirty(sb);
 	brelse(bitmap_bh);
 	return err;
 }
@@ -4692,7 +4691,6 @@ do_more:
 		put_bh(bitmap_bh);
 		goto do_more;
 	}
-	ext4_mark_super_dirty(sb);
 error_return:
 	brelse(bitmap_bh);
 	ext4_std_error(sb, err);
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 2/4] ext4: Convert last user of ext4_mark_super_dirty() to ext4_handle_dirty_super()
  2012-04-02 11:45 [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
  2012-04-02 11:45 ` [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty Artem Bityutskiy
@ 2012-04-02 11:45 ` Artem Bityutskiy
  2012-04-02 11:45 ` Artem Bityutskiy
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-02 11:45 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

From: Jan Kara <jack@suse.cz>

The last user of ext4_mark_super_dirty() in ext4_file_open() is so rare it
can well be modifying the superblock properly by journalling the change.
Change it and get rid of ext4_mark_super_dirty() as it's not needed anymore.

Artem: small amendments.
Artem: tested using xfstests for both journalled and non-journalled ext4.

Signed-off-by: Jan Kara <jack@suse.cz>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ext4/ext4.h |    6 ------
 fs/ext4/file.c |   14 +++++++++++++-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index ab2594a..aba3749 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2226,12 +2226,6 @@ static inline void ext4_unlock_group(struct super_block *sb,
 	spin_unlock(ext4_group_lock_ptr(sb, group));
 }
 
-static inline void ext4_mark_super_dirty(struct super_block *sb)
-{
-	if (EXT4_SB(sb)->s_journal == NULL)
-		sb->s_dirt =1;
-}
-
 /*
  * Block validity checking
  */
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index cb70f18..708b28e 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -181,9 +181,21 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
 		path.dentry = mnt->mnt_root;
 		cp = d_path(&path, buf, sizeof(buf));
 		if (!IS_ERR(cp)) {
+			handle_t *handle;
+			int err;
+
+			handle = ext4_journal_start_sb(sb, 1);
+			if (IS_ERR(handle))
+				return PTR_ERR(handle);
+			err = ext4_journal_get_write_access(handle, sbi->s_sbh);
+			if (err) {
+				ext4_journal_stop(handle);
+				return err;
+			}
 			strlcpy(sbi->s_es->s_last_mounted, cp,
 				sizeof(sbi->s_es->s_last_mounted));
-			ext4_mark_super_dirty(sb);
+			ext4_handle_dirty_super(handle, sb);
+			ext4_journal_stop(handle);
 		}
 	}
 	/*
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 2/4] ext4: Convert last user of ext4_mark_super_dirty() to ext4_handle_dirty_super()
  2012-04-02 11:45 [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
  2012-04-02 11:45 ` [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty Artem Bityutskiy
  2012-04-02 11:45 ` [PATCH v2 2/4] ext4: Convert last user of ext4_mark_super_dirty() to ext4_handle_dirty_super() Artem Bityutskiy
@ 2012-04-02 11:45 ` Artem Bityutskiy
  2012-04-02 11:45 ` [PATCH v2 3/4] ext4: remove unnecessary superblock dirtying Artem Bityutskiy
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-02 11:45 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

From: Jan Kara <jack@suse.cz>

The last user of ext4_mark_super_dirty() in ext4_file_open() is so rare it
can well be modifying the superblock properly by journalling the change.
Change it and get rid of ext4_mark_super_dirty() as it's not needed anymore.

Artem: small amensdments.
Artem: tested using xfstests for both journalled and non-journalled ext4.

Signed-off-by: Jan Kara <jack@suse.cz>
Tested-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ext4/ext4.h |    6 ------
 fs/ext4/file.c |   14 +++++++++++++-
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index ab2594a..aba3749 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2226,12 +2226,6 @@ static inline void ext4_unlock_group(struct super_block *sb,
 	spin_unlock(ext4_group_lock_ptr(sb, group));
 }
 
-static inline void ext4_mark_super_dirty(struct super_block *sb)
-{
-	if (EXT4_SB(sb)->s_journal == NULL)
-		sb->s_dirt =1;
-}
-
 /*
  * Block validity checking
  */
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index cb70f18..708b28e 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -181,9 +181,21 @@ static int ext4_file_open(struct inode * inode, struct file * filp)
 		path.dentry = mnt->mnt_root;
 		cp = d_path(&path, buf, sizeof(buf));
 		if (!IS_ERR(cp)) {
+			handle_t *handle;
+			int err;
+
+			handle = ext4_journal_start_sb(sb, 1);
+			if (IS_ERR(handle))
+				return PTR_ERR(handle);
+			err = ext4_journal_get_write_access(handle, sbi->s_sbh);
+			if (err) {
+				ext4_journal_stop(handle);
+				return err;
+			}
 			strlcpy(sbi->s_es->s_last_mounted, cp,
 				sizeof(sbi->s_es->s_last_mounted));
-			ext4_mark_super_dirty(sb);
+			ext4_handle_dirty_super(handle, sb);
+			ext4_journal_stop(handle);
 		}
 	}
 	/*
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 3/4] ext4: remove unnecessary superblock dirtying
  2012-04-02 11:45 [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
                   ` (2 preceding siblings ...)
  2012-04-02 11:45 ` Artem Bityutskiy
@ 2012-04-02 11:45 ` Artem Bityutskiy
  2012-04-02 21:49   ` Jan Kara
  2012-04-02 11:45 ` [PATCH v2 4/4] ext4: weed out ext4_write_super Artem Bityutskiy
  2012-05-18 10:25 ` [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
  5 siblings, 1 reply; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-02 11:45 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

This patch changes the '__ext4_handle_dirty_super()' function which is used
by ext4 to update the super-block via the journal in the following cases:

1. When creating the first large file on a file
   system without EXT4_FEATURE_RO_COMPAT_LARGE_FILE feature.
2. When re-sizing the file-system
3. When creating an xattr on a file-system without the
   EXT4_FEATURE_COMPAT_EXT_ATTR feature.

This function, however, falls back to just marking the superblock as dirty
if the file-system has no journal. But it is user really rarely and it does not
give any benefit to use the delayed superblock write (via the VFS's
'sync_supers()' kernel thread) in these cases. We can just write out the
superblock asynchronously instead.

This patch also removes 's_dirt' condition on the unmount path because we never
set it anymore, so we should not test it.

Tested using xfstests for both journalled and non-journalled ext4.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ext4/ext4.h      |    1 +
 fs/ext4/ext4_jbd2.c |    2 +-
 fs/ext4/super.c     |    5 ++---
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index aba3749..ba2cf3f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1953,6 +1953,7 @@ extern int ext4_group_extend(struct super_block *sb,
 extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count);
 
 /* super.c */
+int ext4_commit_super(struct super_block *sb, int sync);
 extern void *ext4_kvmalloc(size_t size, gfp_t flags);
 extern void *ext4_kvzalloc(size_t size, gfp_t flags);
 extern void ext4_kvfree(void *ptr);
diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
index aca1790..a85f46f 100644
--- a/fs/ext4/ext4_jbd2.c
+++ b/fs/ext4/ext4_jbd2.c
@@ -149,6 +149,6 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line,
 			ext4_journal_abort_handle(where, line, __func__,
 						  bh, handle, err);
 	} else
-		sb->s_dirt = 1;
+		err = ext4_commit_super(sb, 0);
 	return err;
 }
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index ceebaf8..6b45785 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -63,7 +63,6 @@ static struct ext4_features *ext4_feat;
 static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
 			     unsigned long journal_devnum);
 static int ext4_show_options(struct seq_file *seq, struct dentry *root);
-static int ext4_commit_super(struct super_block *sb, int sync);
 static void ext4_mark_recovery_complete(struct super_block *sb,
 					struct ext4_super_block *es);
 static void ext4_clear_journal_err(struct super_block *sb,
@@ -853,7 +852,7 @@ static void ext4_put_super(struct super_block *sb)
 		EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
 		es->s_state = cpu_to_le16(sbi->s_mount_state);
 	}
-	if (sb->s_dirt || !(sb->s_flags & MS_RDONLY))
+	if (!(sb->s_flags & MS_RDONLY))
 		ext4_commit_super(sb, 1);
 
 	if (sbi->s_proc) {
@@ -3991,7 +3990,7 @@ static int ext4_load_journal(struct super_block *sb,
 	return 0;
 }
 
-static int ext4_commit_super(struct super_block *sb, int sync)
+int ext4_commit_super(struct super_block *sb, int sync)
 {
 	struct ext4_super_block *es = EXT4_SB(sb)->s_es;
 	struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 4/4] ext4: weed out ext4_write_super
  2012-04-02 11:45 [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
                   ` (3 preceding siblings ...)
  2012-04-02 11:45 ` [PATCH v2 3/4] ext4: remove unnecessary superblock dirtying Artem Bityutskiy
@ 2012-04-02 11:45 ` Artem Bityutskiy
  2012-04-02 21:50   ` Jan Kara
  2012-05-18 10:25 ` [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
  5 siblings, 1 reply; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-02 11:45 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

We do not depend on VFS's '->write_super()' anymore and do not need the
's_dirt' flag anymore. This patch weeds out 'ext4_write_super()' and the
's_dirt' usage in VFS.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ext4/super.c |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6b45785..0818eef 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -73,7 +73,6 @@ static const char *ext4_decode_error(struct super_block *sb, int errno,
 static int ext4_remount(struct super_block *sb, int *flags, char *data);
 static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
 static int ext4_unfreeze(struct super_block *sb);
-static void ext4_write_super(struct super_block *sb);
 static int ext4_freeze(struct super_block *sb);
 static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
 		       const char *dev_name, void *data);
@@ -1148,7 +1147,6 @@ static const struct super_operations ext4_nojournal_sops = {
 	.dirty_inode	= ext4_dirty_inode,
 	.drop_inode	= ext4_drop_inode,
 	.evict_inode	= ext4_evict_inode,
-	.write_super	= ext4_write_super,
 	.put_super	= ext4_put_super,
 	.statfs		= ext4_statfs,
 	.remount_fs	= ext4_remount,
@@ -4038,7 +4036,6 @@ int ext4_commit_super(struct super_block *sb, int sync)
 	es->s_free_inodes_count =
 		cpu_to_le32(percpu_counter_sum_positive(
 				&EXT4_SB(sb)->s_freeinodes_counter));
-	sb->s_dirt = 0;
 	BUFFER_TRACE(sbh, "marking dirty");
 	mark_buffer_dirty(sbh);
 	if (sync) {
@@ -4144,13 +4141,6 @@ int ext4_force_commit(struct super_block *sb)
 	return ret;
 }
 
-static void ext4_write_super(struct super_block *sb)
-{
-	lock_super(sb);
-	ext4_commit_super(sb, 1);
-	unlock_super(sb);
-}
-
 static int ext4_sync_fs(struct super_block *sb, int wait)
 {
 	int ret = 0;
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 3/4] ext4: remove unnecessary superblock dirtying
  2012-04-02 11:45 ` [PATCH v2 3/4] ext4: remove unnecessary superblock dirtying Artem Bityutskiy
@ 2012-04-02 21:49   ` Jan Kara
  0 siblings, 0 replies; 16+ messages in thread
From: Jan Kara @ 2012-04-02 21:49 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: Ted Tso, Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

On Mon 02-04-12 14:45:39, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> 
> This patch changes the '__ext4_handle_dirty_super()' function which is used
> by ext4 to update the super-block via the journal in the following cases:
> 
> 1. When creating the first large file on a file
>    system without EXT4_FEATURE_RO_COMPAT_LARGE_FILE feature.
> 2. When re-sizing the file-system
> 3. When creating an xattr on a file-system without the
>    EXT4_FEATURE_COMPAT_EXT_ATTR feature.
> 
> This function, however, falls back to just marking the superblock as dirty
> if the file-system has no journal. But it is user really rarely and it does not
> give any benefit to use the delayed superblock write (via the VFS's
> 'sync_supers()' kernel thread) in these cases. We can just write out the
> superblock asynchronously instead.
> 
> This patch also removes 's_dirt' condition on the unmount path because we never
> set it anymore, so we should not test it.
> 
> Tested using xfstests for both journalled and non-journalled ext4.
> 
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  Looks good.
Reviewed-by: Jan Kara <jack@suse.cz>

									Honza
> ---
>  fs/ext4/ext4.h      |    1 +
>  fs/ext4/ext4_jbd2.c |    2 +-
>  fs/ext4/super.c     |    5 ++---
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index aba3749..ba2cf3f 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -1953,6 +1953,7 @@ extern int ext4_group_extend(struct super_block *sb,
>  extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count);
>  
>  /* super.c */
> +int ext4_commit_super(struct super_block *sb, int sync);
>  extern void *ext4_kvmalloc(size_t size, gfp_t flags);
>  extern void *ext4_kvzalloc(size_t size, gfp_t flags);
>  extern void ext4_kvfree(void *ptr);
> diff --git a/fs/ext4/ext4_jbd2.c b/fs/ext4/ext4_jbd2.c
> index aca1790..a85f46f 100644
> --- a/fs/ext4/ext4_jbd2.c
> +++ b/fs/ext4/ext4_jbd2.c
> @@ -149,6 +149,6 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line,
>  			ext4_journal_abort_handle(where, line, __func__,
>  						  bh, handle, err);
>  	} else
> -		sb->s_dirt = 1;
> +		err = ext4_commit_super(sb, 0);
>  	return err;
>  }
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index ceebaf8..6b45785 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -63,7 +63,6 @@ static struct ext4_features *ext4_feat;
>  static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
>  			     unsigned long journal_devnum);
>  static int ext4_show_options(struct seq_file *seq, struct dentry *root);
> -static int ext4_commit_super(struct super_block *sb, int sync);
>  static void ext4_mark_recovery_complete(struct super_block *sb,
>  					struct ext4_super_block *es);
>  static void ext4_clear_journal_err(struct super_block *sb,
> @@ -853,7 +852,7 @@ static void ext4_put_super(struct super_block *sb)
>  		EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER);
>  		es->s_state = cpu_to_le16(sbi->s_mount_state);
>  	}
> -	if (sb->s_dirt || !(sb->s_flags & MS_RDONLY))
> +	if (!(sb->s_flags & MS_RDONLY))
>  		ext4_commit_super(sb, 1);
>  
>  	if (sbi->s_proc) {
> @@ -3991,7 +3990,7 @@ static int ext4_load_journal(struct super_block *sb,
>  	return 0;
>  }
>  
> -static int ext4_commit_super(struct super_block *sb, int sync)
> +int ext4_commit_super(struct super_block *sb, int sync)
>  {
>  	struct ext4_super_block *es = EXT4_SB(sb)->s_es;
>  	struct buffer_head *sbh = EXT4_SB(sb)->s_sbh;
> -- 
> 1.7.7.6
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 4/4] ext4: weed out ext4_write_super
  2012-04-02 11:45 ` [PATCH v2 4/4] ext4: weed out ext4_write_super Artem Bityutskiy
@ 2012-04-02 21:50   ` Jan Kara
  0 siblings, 0 replies; 16+ messages in thread
From: Jan Kara @ 2012-04-02 21:50 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: Ted Tso, Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

On Mon 02-04-12 14:45:40, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> 
> We do not depend on VFS's '->write_super()' anymore and do not need the
> 's_dirt' flag anymore. This patch weeds out 'ext4_write_super()' and the
> 's_dirt' usage in VFS.
> 
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  Looks good.
Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
> ---
>  fs/ext4/super.c |   10 ----------
>  1 files changed, 0 insertions(+), 10 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 6b45785..0818eef 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -73,7 +73,6 @@ static const char *ext4_decode_error(struct super_block *sb, int errno,
>  static int ext4_remount(struct super_block *sb, int *flags, char *data);
>  static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf);
>  static int ext4_unfreeze(struct super_block *sb);
> -static void ext4_write_super(struct super_block *sb);
>  static int ext4_freeze(struct super_block *sb);
>  static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
>  		       const char *dev_name, void *data);
> @@ -1148,7 +1147,6 @@ static const struct super_operations ext4_nojournal_sops = {
>  	.dirty_inode	= ext4_dirty_inode,
>  	.drop_inode	= ext4_drop_inode,
>  	.evict_inode	= ext4_evict_inode,
> -	.write_super	= ext4_write_super,
>  	.put_super	= ext4_put_super,
>  	.statfs		= ext4_statfs,
>  	.remount_fs	= ext4_remount,
> @@ -4038,7 +4036,6 @@ int ext4_commit_super(struct super_block *sb, int sync)
>  	es->s_free_inodes_count =
>  		cpu_to_le32(percpu_counter_sum_positive(
>  				&EXT4_SB(sb)->s_freeinodes_counter));
> -	sb->s_dirt = 0;
>  	BUFFER_TRACE(sbh, "marking dirty");
>  	mark_buffer_dirty(sbh);
>  	if (sync) {
> @@ -4144,13 +4141,6 @@ int ext4_force_commit(struct super_block *sb)
>  	return ret;
>  }
>  
> -static void ext4_write_super(struct super_block *sb)
> -{
> -	lock_super(sb);
> -	ext4_commit_super(sb, 1);
> -	unlock_super(sb);
> -}
> -
>  static int ext4_sync_fs(struct super_block *sb, int wait)
>  {
>  	int ret = 0;
> -- 
> 1.7.7.6
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-04-02 11:45 ` [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty Artem Bityutskiy
@ 2012-04-12  7:20   ` Artem Bityutskiy
  2012-04-30  8:37     ` Artem Bityutskiy
  0 siblings, 1 reply; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-12  7:20 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 572 bytes --]

On Mon, 2012-04-02 at 14:45 +0300, Artem Bityutskiy wrote:
> From: Jan Kara <jack@suse.cz>
> 
> Commit a0375156 properly notes that superblock doesn't need to be marked
> as dirty when only number of free inodes / blocks / number of directories
> changes since that is recomputed on each mount anyway. However that comment
> leaves some unnecessary markings as dirty in place. Remove these.
> 
> Artem: tested using xfstests for both journalled and non-journalled ext4.

Hi Ted, what would be the fate of this patch-set?

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-04-12  7:20   ` Artem Bityutskiy
@ 2012-04-30  8:37     ` Artem Bityutskiy
  2012-06-01 13:53       ` Artem Bityutskiy
  0 siblings, 1 reply; 16+ messages in thread
From: Artem Bityutskiy @ 2012-04-30  8:37 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 740 bytes --]

On Thu, 2012-04-12 at 10:20 +0300, Artem Bityutskiy wrote:
> On Mon, 2012-04-02 at 14:45 +0300, Artem Bityutskiy wrote:
> > From: Jan Kara <jack@suse.cz>
> > 
> > Commit a0375156 properly notes that superblock doesn't need to be marked
> > as dirty when only number of free inodes / blocks / number of directories
> > changes since that is recomputed on each mount anyway. However that comment
> > leaves some unnecessary markings as dirty in place. Remove these.
> > 
> > Artem: tested using xfstests for both journalled and non-journalled ext4.
> 
> Hi Ted, what would be the fate of this patch-set?

Hi Ted, I am sorry for being annoying, but what do you think about these
patches?

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] do not use s_dirt in ext4
  2012-04-02 11:45 [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
                   ` (4 preceding siblings ...)
  2012-04-02 11:45 ` [PATCH v2 4/4] ext4: weed out ext4_write_super Artem Bityutskiy
@ 2012-05-18 10:25 ` Artem Bityutskiy
  5 siblings, 0 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-05-18 10:25 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 1437 bytes --]

Hi Ted,

the merge window is about to open and I am getting worried about this
patch-set - I won't have time to fix it if you indicate an issue...

On Mon, 2012-04-02 at 14:45 +0300, Artem Bityutskiy wrote:
> This patch-set makes ext4 independent of the VFS superblock management
> services. Namely, ext4 does not require to register the 'write_super()' VFS
> call-back.
> 
> The reason of this exercises is to get rid of the 'sync_supers()' kernel thread
> which wakes up every 5 seconds (by default) even if all superblocks are clean.
> This is wasteful from power management POW (unnecessary wake-ups).
> 
> Version 1 of this patch-set can be found here:
> https://lkml.org/lkml/2012/3/20/220
> 
> Changes between v1 and v2.
>   * Rake different strategy - instead of pushing 's_dirt' down "as-is" and
>     emulating old behavior, we now just submit the superblock for writing
>     straight away, either via the journal or directly. Thank to Jan Kara
>     for helping with this.
>   * Ted picked some of the patches already, which made this series shorter
>     - thanks!
>   * This time I've tested the changes using xfstests.
>   * Rebased to 3.4-rc1.
> 
> Note: Ted, you merged the "mm: export dirty_writeback_interval", but it looks
> like we won't need this for ext[23]. However, for other file-systems we will
> need this change.
> 
> Thanks,
> Artem.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-04-30  8:37     ` Artem Bityutskiy
@ 2012-06-01 13:53       ` Artem Bityutskiy
  2012-06-01 13:55         ` Artem Bityutskiy
  2012-06-01 15:16         ` Ted Ts'o
  0 siblings, 2 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-06-01 13:53 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 879 bytes --]

On Mon, 2012-04-30 at 11:37 +0300, Artem Bityutskiy wrote:
> On Thu, 2012-04-12 at 10:20 +0300, Artem Bityutskiy wrote:
> > On Mon, 2012-04-02 at 14:45 +0300, Artem Bityutskiy wrote:
> > > From: Jan Kara <jack@suse.cz>
> > > 
> > > Commit a0375156 properly notes that superblock doesn't need to be marked
> > > as dirty when only number of free inodes / blocks / number of directories
> > > changes since that is recomputed on each mount anyway. However that comment
> > > leaves some unnecessary markings as dirty in place. Remove these.
> > > 
> > > Artem: tested using xfstests for both journalled and non-journalled ext4.
> > 
> > Hi Ted, what would be the fate of this patch-set?
> 
> Hi Ted, I am sorry for being annoying, but what do you think about these
> patches?

Hi Ted, any chance for this stuff to hit 3.4?

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-06-01 13:53       ` Artem Bityutskiy
@ 2012-06-01 13:55         ` Artem Bityutskiy
  2012-06-01 15:16         ` Ted Ts'o
  1 sibling, 0 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-06-01 13:55 UTC (permalink / raw)
  To: Ted Tso
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

On Fri, 2012-06-01 at 16:53 +0300, Artem Bityutskiy wrote:
> Hi Ted, any chance for this stuff to hit 3.4?

Sorry, of course I actually meant the current merge window for 3.5.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-06-01 13:53       ` Artem Bityutskiy
  2012-06-01 13:55         ` Artem Bityutskiy
@ 2012-06-01 15:16         ` Ted Ts'o
  2012-06-01 17:48           ` Artem Bityutskiy
  2012-06-21 13:11           ` Artem Bityutskiy
  1 sibling, 2 replies; 16+ messages in thread
From: Ted Ts'o @ 2012-06-01 15:16 UTC (permalink / raw)
  To: Artem Bityutskiy
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

On Fri, Jun 01, 2012 at 04:53:40PM +0300, Artem Bityutskiy wrote:
> 
> Hi Ted, any chance for this stuff to hit 3.4?
> 

Hi Artem,

I'm very sorry, this has been completely my fault; this has been an
absolutely crazy month this past May, and this just slipped off my
radar, and we're just out of time.  I will make sure this patchset
gets reviewed and queued for 3.5.

						- Ted

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-06-01 15:16         ` Ted Ts'o
@ 2012-06-01 17:48           ` Artem Bityutskiy
  2012-06-21 13:11           ` Artem Bityutskiy
  1 sibling, 0 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-06-01 17:48 UTC (permalink / raw)
  To: Ted Ts'o
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 649 bytes --]

On Fri, 2012-06-01 at 11:16 -0400, Ted Ts'o wrote:
> I'm very sorry, this has been completely my fault; this has been an
> absolutely crazy month this past May, and this just slipped off my
> radar, and we're just out of time.  I will make sure this patchset
> gets reviewed and queued for 3.5.

No problem, thanks for reply. I think it would be safer if could take it
to your tree (providing it is OK) and it would go through the normal
cycle and hit 3.6, not 3.5. There is no rush with this - I need to take
care of several other file-systems before the whole kernel thread can be
killed anyway.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty
  2012-06-01 15:16         ` Ted Ts'o
  2012-06-01 17:48           ` Artem Bityutskiy
@ 2012-06-21 13:11           ` Artem Bityutskiy
  1 sibling, 0 replies; 16+ messages in thread
From: Artem Bityutskiy @ 2012-06-21 13:11 UTC (permalink / raw)
  To: Ted Ts'o
  Cc: Linux Kernel Maling List, Linux FS Maling List,
	Ext4 Mailing List, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

On Fri, 2012-06-01 at 11:16 -0400, Ted Ts'o wrote:
> I will make sure this patchset
> gets reviewed and queued for 3.5.

Hi Ted,

just a reminder. The patch does not apply cleanly but the conflicts are
simple and they are around the SB checksum stuff. Do you want me to
re-send?

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2012-06-21 13:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-02 11:45 [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy
2012-04-02 11:45 ` [PATCH v2 1/4] ext4: Remove useless marking of superblock dirty Artem Bityutskiy
2012-04-12  7:20   ` Artem Bityutskiy
2012-04-30  8:37     ` Artem Bityutskiy
2012-06-01 13:53       ` Artem Bityutskiy
2012-06-01 13:55         ` Artem Bityutskiy
2012-06-01 15:16         ` Ted Ts'o
2012-06-01 17:48           ` Artem Bityutskiy
2012-06-21 13:11           ` Artem Bityutskiy
2012-04-02 11:45 ` [PATCH v2 2/4] ext4: Convert last user of ext4_mark_super_dirty() to ext4_handle_dirty_super() Artem Bityutskiy
2012-04-02 11:45 ` Artem Bityutskiy
2012-04-02 11:45 ` [PATCH v2 3/4] ext4: remove unnecessary superblock dirtying Artem Bityutskiy
2012-04-02 21:49   ` Jan Kara
2012-04-02 11:45 ` [PATCH v2 4/4] ext4: weed out ext4_write_super Artem Bityutskiy
2012-04-02 21:50   ` Jan Kara
2012-05-18 10:25 ` [PATCH v2 0/4] do not use s_dirt in ext4 Artem Bityutskiy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.