Skip to contentSkip to conversation

VFS: introduce s_dirty accessors

PATCH In review Artem Bityutskiy 4 participants 7 messages Jun 10, 2010 – Jul 10, 2010 VFS

lore
Share & tools
lore
#0 lore raw

cover VFS: introduce s_dirty accessors

Hi Linus,

would it be possible to add the following patch to your tree. I'm trying to lessen amount of useless wake-ups in the kernel, and the 'sync_supers' thread if one of those kernel threads which wakes up every 5 seconds to (mostly) do nothing.

This is still work in progress, but putting the below patch to your tree would make life easier at the next merge window. This patch just adds 3 accessor functions, but no one will use them so fare, so it must be harmless. This was suggested by Ted and supported by Al:
http://lkml.org/lkml/2010/6/9/216

Artem.

#1 lore raw

PATCH 1/1 VFS: introduce s_dirty accessors

From: Artem Bityutskiy <[email protected]>

This patch introduces 3 VFS accessors: 'sb_mark_dirty()', 'sb_mark_clean()', and 'sb_is_dirty()'. They simply set 'sb->s_dirt' or test 'sb->s_dirt'. The plan is to make every FS use these accessors later instead of manipulating the 'sb->s_dirt' flag directly.

Ultimately, this change is a preparation for the periodic superblock synchronization optimization which is about preventing the "sync_supers" kernel thread from waking up even if there is nothing to synchronize.

This patch does not do any functional change, just adds accessor functions.

---
 include/linux/fs.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
include/linux/fs.h +13 -0
index 471e1ff..68ca1b0 100644
@@ -1783,6 +1783,19 @@ extern int get_sb_pseudo(struct file_system_type *, char *,
 	struct vfsmount *mnt);
 extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
 
+static inline void sb_mark_dirty(struct super_block *sb)
+{
+	sb->s_dirt = 1;
+}
+static inline void sb_mark_clean(struct super_block *sb)
+{
+	sb->s_dirt = 0;
+}
+static inline int sb_is_dirty(struct super_block *sb)
+{
+	return sb->s_dirt;
+}
+
 /* Alas, no aliases. Too much hassle with bringing module.h everywhere */
 #define fops_get(fops) \
 	(((fops) && try_module_get((fops)->owner) ? (fops) : NULL))
Signature · 1 line
1.7.0.1
maintainer
#2 lore raw
Quoted 8 lines · Artem Bityutskiy

From: Artem Bityutskiy <[email protected]>

This patch introduces 3 VFS accessors: 'sb_mark_dirty()', 'sb_mark_clean()', and 'sb_is_dirty()'. They simply set 'sb->s_dirt' or test 'sb->s_dirt'. The plan is to make every FS use these accessors later instead of manipulating the 'sb->s_dirt' flag directly.

Quoted 7 lines

Ultimately, this change is a preparation for the periodic superblock synchronization optimization which is about preventing the "sync_supers" kernel thread from waking up even if there is nothing to synchronize.

This patch does not do any functional change, just adds accessor functions.

Applied and pushed. It's in for-next, which should do until Linus comes back and picks it...

#3 lore raw
In reply to Artem Bityutskiy
Quoted 7 lines · Artem Bityutskiy

Hi Linus,

would it be possible to add the following patch to your tree. I'm trying to lessen amount of useless wake-ups in the kernel, and the 'sync_supers' thread if one of those kernel threads which wakes up every 5 seconds to (mostly) do nothing.

Quoted 5 lines

This is still work in progress, but putting the below patch to your tree would make life easier at the next merge window. This patch just adds 3 accessor functions, but no one will use them so fare, so it must be harmless. This was suggested by Ted and supported by Al:
http://lkml.org/lkml/2010/6/9/216

Linus,

I wonder, you did not take this because of the vacation or because you do not like it?

Signature · 7 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
Quoted 4 lines · Artem Bityutskiy

Linus,

I wonder, you did not take this because of the vacation or because you do not like it?

I'd suggest resending the patch to Linus.

- Ted

#5 lore raw
Quoted 8 lines · On Fri, 9 Jul 2010 18:27:37 -0400 [email protected] wrote:
Quoted 4 lines · Artem Bityutskiy

Linus,

I wonder, you did not take this because of the vacation or because you do not like it?

I'd suggest resending the patch to Linus.

this:

: commit 140236b4b1c749c9b795ea3d11558a0eb5a3a080 : Author: Artem Bityutskiy <[email protected]>
: Date: Thu Jun 10 13:56:33 2010 +0300
:
: VFS: introduce s_dirty accessors

was merged into mainline a few days ago?

#6 lore raw
Quoted 11 lines

On Fri, 9 Jul 2010 18:27:37 -0400
[email protected] wrote:
this:

: commit 140236b4b1c749c9b795ea3d11558a0eb5a3a080 : Author: Artem Bityutskiy <[email protected]>
: Date: Thu Jun 10 13:56:33 2010 +0300
:
: VFS: introduce s_dirty accessors

was merged into mainline a few days ago?

Yeah, it was merged. Now I'm patiently waiting for Al's response for the rest.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)