2010-06-04 04:26:10

by Al Viro

[permalink] [raw]
Subject: Re: [PATCHv4 17/17] writeback: lessen sync_supers wakeup count

On Mon, May 31, 2010 at 05:07:00PM +0300, Artem Bityutskiy wrote:
> you requested me to review s_dirt usage, well, I'm trying now. One thing
> I do not understand is s_dirt serialization, which seems to be just
> absent in some FSes. I checked affs and ext2. E.g., affs does:
>
> affs_alloc_block()
> {
> mark_buffer_dirty(bh);
> sb->s_dirt = 1;
> }
>
> vs
>
> affs_write_super()
> {
> affs_commit_super();
> /* YYY: what if sb is marked as dirty right here? */
> sb->s_dirt = 0;
> }
>
> vs
>
> /* This wakes up periodically */
> sync_super()
> {
> if (sb->s_root && sb->s_dirt)
> sb->s_op->write_super(sb);
> }
>
> ext2 seems to be doing something similar. It seems to me that FSes
> should serialize s_dirt changes somehow, but they don't? Why this is not
> a problem?

I suspect that most of those used to rely on lock_super() way back.
In case of ext2_sync_super() we probably want just to move ->s_dirt = 0
into the very beginning; no serialization is really needed beyond (_maybe_)
some barriers. No idea about affs, needs to be checked.


2010-06-04 05:17:15

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCHv4 17/17] writeback: lessen sync_supers wakeup count

On Fri, 2010-06-04 at 05:26 +0100, Al Viro wrote:
> I suspect that most of those used to rely on lock_super() way back.
> In case of ext2_sync_super() we probably want just to move ->s_dirt = 0
> into the very beginning; no serialization is really needed beyond (_maybe_)
> some barriers. No idea about affs, needs to be checked.

Yeah, moving s_dirt to the beginning should work. I think the same
should be done for affs. I'll look at other FS-es WRT this as well.

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