2010-06-10 11:00:38

by Artem Bityutskiy

[permalink] [raw]
Subject: [PATCH 0/1] 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.


2010-06-10 11:00:45

by Artem Bityutskiy

[permalink] [raw]
Subject: [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.

Signed-off-by: Artem Bityutskiy <[email protected]>
---
include/linux/fs.h | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 471e1ff..68ca1b0 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -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))
--
1.7.0.1

2010-06-11 01:43:00

by Al Viro

[permalink] [raw]
Subject: Re: [PATCH 1/1] VFS: introduce s_dirty accessors

On Thu, Jun 10, 2010 at 01:56:33PM +0300, Artem Bityutskiy wrote:
> 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.

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

2010-07-05 13:08:24

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCH 0/1] VFS: introduce s_dirty accessors

On Thu, 2010-06-10 at 13:56 +0300, Artem Bityutskiy wrote:
> 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

Linus,

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

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

2010-07-09 22:27:45

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH 0/1] VFS: introduce s_dirty accessors

On Mon, Jul 05, 2010 at 04:04:27PM +0300, Artem Bityutskiy wrote:
> 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

2010-07-09 22:31:53

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH 0/1] VFS: introduce s_dirty accessors

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

> On Mon, Jul 05, 2010 at 04:04:27PM +0300, Artem Bityutskiy wrote:
> > 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?

2010-07-10 04:33:39

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCH 0/1] VFS: introduce s_dirty accessors

> 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.

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)