Re: [PATCH 04/27] ext2: Add ext2_sb_info mutex
From: Jan Blunck
Date: Mon Nov 02 2009 - 11:58:06 EST
On Mon, Nov 02, Andi Kleen wrote:
> > @@ -762,6 +767,12 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
> > sbi->s_sb_block = sb_block;
> >
> > /*
> > + * mutex for protection of modifications of the superblock while being
> > + * write out by ext2_write_super() or ext2_sync_fs().
> > + */
> > + mutex_init(&sbi->s_mutex);
>
> I didn't go over all the code paths in detail, but if you replace
> the BKL with a mutex that is hold over a longer write-out sleep
> period you potentially limit IO parallelism a lot.
Right. I converted it to be a spinlock and unlock before calling
ext2_sync_super().
What do you think?
Thanks,
Jan