From: Andrew Morton on
On Tue, 6 May 2008 13:35:32 +0300 Artem Bityutskiy <Artem.Bityutskiy(a)nokia.com> wrote:

> Let file systems to writeback their pages and inodes when needed. This
> is needed for UBIFS budgeting sub-system because it has to force
> write-back from time to time.
>
> Note, it cannot be called if one of the dirty pages is locked by
> the caller, otherwise it'll deadlock.
>
> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy(a)nokia.com>
> Signed-off-by: Adrian Hunter <ext-adrian.hunter(a)nokia.com>
> ---
> fs/fs-writeback.c | 8 ++++++++
> include/linux/writeback.h | 1 +
> 2 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
> index 0655767..4591270 100644
> --- a/fs/fs-writeback.c
> +++ b/fs/fs-writeback.c
> @@ -573,6 +573,14 @@ void sync_inodes_sb(struct super_block *sb, int wait)
> spin_unlock(&inode_lock);
> }
>
> +void writeback_inodes_sb(struct super_block *sb, struct writeback_control *wbc)
> +{
> + spin_lock(&inode_lock);
> + sync_sb_inodes(sb, wbc);
> + spin_unlock(&inode_lock);
> +}
> +EXPORT_SYMBOL_GPL(writeback_inodes_sb);
> +
> /*
> * Rather lame livelock avoidance.
> */
> diff --git a/include/linux/writeback.h b/include/linux/writeback.h
> index b7b3362..0083a0a 100644
> --- a/include/linux/writeback.h
> +++ b/include/linux/writeback.h
> @@ -71,6 +71,7 @@ struct writeback_control {
> void writeback_inodes(struct writeback_control *wbc);
> int inode_wait(void *);
> void sync_inodes_sb(struct super_block *, int wait);
> +void writeback_inodes_sb(struct super_block *sb, struct writeback_control *wbc);
> void sync_inodes(int wait);
>

This looks rather similar to
http://userweb.kernel.org/~akpm/mmotm/broken-out/reiser4-sb_sync_inodes.patch

Which is best?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Christoph Hellwig on
On Wed, May 07, 2008 at 12:23:45AM -0700, Andrew Morton wrote:
> > --- a/fs/fs-writeback.c
> > +++ b/fs/fs-writeback.c
> > @@ -573,6 +573,14 @@ void sync_inodes_sb(struct super_block *sb, int wait)
> > spin_unlock(&inode_lock);
> > }
> >
> > +void writeback_inodes_sb(struct super_block *sb, struct writeback_control *wbc)
> > +{
> > + spin_lock(&inode_lock);
> > + sync_sb_inodes(sb, wbc);
> > + spin_unlock(&inode_lock);
> > +}
> This looks rather similar to
> http://userweb.kernel.org/~akpm/mmotm/broken-out/reiser4-sb_sync_inodes.patch
>
> Which is best?

I think sync_sb_inodes should just lock/unlock the inode_lock itself as
per the patch from the reiser4 queue. But before we export it I'd like
to review what ubifs actually does with it.

Anyone care to submit a patch to just move the locking that we could
put in ASAP?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Artem Bityutskiy on
Hi Andrew,

Andrew Morton wrote:
> This looks rather similar to
> http://userweb.kernel.org/~akpm/mmotm/broken-out/reiser4-sb_sync_inodes.patch
>
> Which is best?

Well, this reiser4 patch is basically doing 3 things at once:
1. Introduce ->sync_inodes()
2. Move spin_lock(&inode_lock);
3. Export generic_sync_sb_inodes()

As Christoph suggested, I've attached a patch which just moves the
spinlock. Could you please consider sending it to Linus or taking into your tree?
Should I amend the reiser4 patch correspondingly for you?

Also, what do you think about taking UBIFS into your tree?

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
From: Artem Bityutskiy on
Artem Bityutskiy wrote:
> As Christoph suggested, I've attached a patch which just moves the
> spinlock. Could you please consider sending it to Linus or taking into
> your tree?

Note, I have tested this patch and it works fine.

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Andrew Morton on
On Wed, 07 May 2008 14:14:41 +0300 Artem Bityutskiy <dedekind(a)yandex.ru> wrote:

> Hi Andrew,
>
> Andrew Morton wrote:
> > This looks rather similar to
> > http://userweb.kernel.org/~akpm/mmotm/broken-out/reiser4-sb_sync_inodes.patch
> >
> > Which is best?
>
> Well, this reiser4 patch is basically doing 3 things at once:
> 1. Introduce ->sync_inodes()
> 2. Move spin_lock(&inode_lock);
> 3. Export generic_sync_sb_inodes()
>
> As Christoph suggested, I've attached a patch which just moves the
> spinlock. Could you please consider sending it to Linus or taking into your tree?

I already added gti-ubifs.patch to the -mm lineup. I haven't yet tried
pulling, merging or compiling it.

I'd suggest that you just retain this patch in your tree.

> Should I amend the reiser4 patch correspondingly for you?

That would be nice, if you have time, thanks.

> Also, what do you think about taking UBIFS into your tree?

I take git trees pretty promiscuously, to get them a bit more exposure and
merge/build testing.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/