* [GIT PULL] a few writeback fixes
@ 2009-09-21 12:56 Jens Axboe
2009-09-21 13:08 ` Wu Fengguang
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Jens Axboe @ 2009-09-21 12:56 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Linux Kernel, jack, fengguang.wu
Hi Linus,
This fixes a problem with NFS killing its bdi without being initialized,
and also contains a fix for a busy loop (where we forgot to set the
task state before sleeping). Since these are a bit critical for -rc1,
I'm pushing them out before leaving for Portland.
Jan, since we're not really sure on the inode wait yet, I dropped that
patch. It's definitely something to look into, as are the congestion
bits.
I plan on adding some writeback tracing code while on the plane for
further analysis when I get back.
git://git.kernel.dk/linux-2.6-block.git writeback
Jens Axboe (4):
nfs: nfs_kill_super() should call bdi_unregister() after killing super
writeback: don't use schedule_timeout() without setting runstate
writeback: make balance_dirty_pages() gradually back more off
nfs: initialize the backing_dev_info when creating the server
fs/nfs/client.c | 10 ++++++----
fs/nfs/super.c | 2 +-
mm/page-writeback.c | 11 ++++++++++-
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index e350bd6..a7ce15d 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -933,10 +933,6 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
goto out_error;
nfs_server_set_fsinfo(server, &fsinfo);
- error = bdi_init(&server->backing_dev_info);
- if (error)
- goto out_error;
-
/* Get some general file system info */
if (server->namelen == 0) {
@@ -995,6 +991,12 @@ static struct nfs_server *nfs_alloc_server(void)
return NULL;
}
+ if (bdi_init(&server->backing_dev_info)) {
+ nfs_free_iostats(server->io_stats);
+ kfree(server);
+ return NULL;
+ }
+
return server;
}
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index de93569..f1cc058 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2190,8 +2190,8 @@ static void nfs_kill_super(struct super_block *s)
{
struct nfs_server *server = NFS_SB(s);
- bdi_unregister(&server->backing_dev_info);
kill_anon_super(s);
+ bdi_unregister(&server->backing_dev_info);
nfs_fscache_release_super_cookie(s);
nfs_free_server(server);
}
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 1eea4fa..6bb510b 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -485,6 +485,7 @@ static void balance_dirty_pages(struct address_space *mapping)
unsigned long bdi_thresh;
unsigned long pages_written = 0;
unsigned long write_chunk = sync_writeback_pages();
+ unsigned long pause = 1;
struct backing_dev_info *bdi = mapping->backing_dev_info;
@@ -561,7 +562,15 @@ static void balance_dirty_pages(struct address_space *mapping)
if (pages_written >= write_chunk)
break; /* We've done our duty */
- schedule_timeout(1);
+ schedule_timeout_interruptible(pause);
+
+ /*
+ * Increase the delay for each loop, up to our previous
+ * default of taking a 100ms nap.
+ */
+ pause <<= 1;
+ if (pause < HZ / 10)
+ pause = HZ / 10;
}
if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh &&
--
Jens Axboe
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [GIT PULL] a few writeback fixes
2009-09-21 12:56 [GIT PULL] a few writeback fixes Jens Axboe
@ 2009-09-21 13:08 ` Wu Fengguang
2009-09-21 13:11 ` Jan Kara
2009-09-21 16:42 ` Ingo Molnar
2 siblings, 0 replies; 6+ messages in thread
From: Wu Fengguang @ 2009-09-21 13:08 UTC (permalink / raw)
To: Jens Axboe; +Cc: Linus Torvalds, Linux Kernel, jack@suse.cz
On Mon, Sep 21, 2009 at 08:56:20PM +0800, Jens Axboe wrote:
> Hi Linus,
>
> This fixes a problem with NFS killing its bdi without being initialized,
> and also contains a fix for a busy loop (where we forgot to set the
> task state before sleeping). Since these are a bit critical for -rc1,
> I'm pushing them out before leaving for Portland.
Jens, I confirmed that it fixed the problem I encountered.
Thanks,
Fengguang
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] a few writeback fixes
2009-09-21 12:56 [GIT PULL] a few writeback fixes Jens Axboe
2009-09-21 13:08 ` Wu Fengguang
@ 2009-09-21 13:11 ` Jan Kara
2009-09-21 13:41 ` Jens Axboe
2009-09-21 16:42 ` Ingo Molnar
2 siblings, 1 reply; 6+ messages in thread
From: Jan Kara @ 2009-09-21 13:11 UTC (permalink / raw)
To: Jens Axboe; +Cc: Linus Torvalds, Linux Kernel, jack, fengguang.wu
On Mon 21-09-09 14:56:20, Jens Axboe wrote:
Hi Jens,
> Jan, since we're not really sure on the inode wait yet, I dropped that
> patch. It's definitely something to look into, as are the congestion
> bits.
OK.
Honza
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 1eea4fa..6bb510b 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -485,6 +485,7 @@ static void balance_dirty_pages(struct address_space *mapping)
> unsigned long bdi_thresh;
> unsigned long pages_written = 0;
> unsigned long write_chunk = sync_writeback_pages();
> + unsigned long pause = 1;
>
> struct backing_dev_info *bdi = mapping->backing_dev_info;
>
> @@ -561,7 +562,15 @@ static void balance_dirty_pages(struct address_space *mapping)
> if (pages_written >= write_chunk)
> break; /* We've done our duty */
>
> - schedule_timeout(1);
> + schedule_timeout_interruptible(pause);
> +
> + /*
> + * Increase the delay for each loop, up to our previous
> + * default of taking a 100ms nap.
> + */
> + pause <<= 1;
> + if (pause < HZ / 10)
> + pause = HZ / 10;
Isn't this check the other way around?
> }
>
> if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh &&
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] a few writeback fixes
2009-09-21 13:11 ` Jan Kara
@ 2009-09-21 13:41 ` Jens Axboe
0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2009-09-21 13:41 UTC (permalink / raw)
To: Jan Kara; +Cc: Linus Torvalds, Linux Kernel, fengguang.wu
On Mon, Sep 21 2009, Jan Kara wrote:
> On Mon 21-09-09 14:56:20, Jens Axboe wrote:
> Hi Jens,
>
> > Jan, since we're not really sure on the inode wait yet, I dropped that
> > patch. It's definitely something to look into, as are the congestion
> > bits.
> OK.
>
> Honza
>
> > diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> > index 1eea4fa..6bb510b 100644
> > --- a/mm/page-writeback.c
> > +++ b/mm/page-writeback.c
> > @@ -485,6 +485,7 @@ static void balance_dirty_pages(struct address_space *mapping)
> > unsigned long bdi_thresh;
> > unsigned long pages_written = 0;
> > unsigned long write_chunk = sync_writeback_pages();
> > + unsigned long pause = 1;
> >
> > struct backing_dev_info *bdi = mapping->backing_dev_info;
> >
> > @@ -561,7 +562,15 @@ static void balance_dirty_pages(struct address_space *mapping)
> > if (pages_written >= write_chunk)
> > break; /* We've done our duty */
> >
> > - schedule_timeout(1);
> > + schedule_timeout_interruptible(pause);
> > +
> > + /*
> > + * Increase the delay for each loop, up to our previous
> > + * default of taking a 100ms nap.
> > + */
> > + pause <<= 1;
> > + if (pause < HZ / 10)
> > + pause = HZ / 10;
> Isn't this check the other way around?
Gah it is, how silly. I have fixed it up. Thanks, eagle eyes :-)
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] a few writeback fixes
2009-09-21 12:56 [GIT PULL] a few writeback fixes Jens Axboe
2009-09-21 13:08 ` Wu Fengguang
2009-09-21 13:11 ` Jan Kara
@ 2009-09-21 16:42 ` Ingo Molnar
2009-09-21 19:02 ` Jens Axboe
2 siblings, 1 reply; 6+ messages in thread
From: Ingo Molnar @ 2009-09-21 16:42 UTC (permalink / raw)
To: Jens Axboe; +Cc: Linus Torvalds, Linux Kernel, jack, fengguang.wu
* Jens Axboe <jens.axboe@oracle.com> wrote:
> Hi Linus,
>
> This fixes a problem with NFS killing its bdi without being
> initialized, and also contains a fix for a busy loop (where we forgot
> to set the task state before sleeping). Since these are a bit critical
> for -rc1, I'm pushing them out before leaving for Portland.
>
> Jan, since we're not really sure on the inode wait yet, I dropped that
> patch. It's definitely something to look into, as are the congestion
> bits.
>
> I plan on adding some writeback tracing code while on the plane for
> further analysis when I get back.
>
> git://git.kernel.dk/linux-2.6-block.git writeback
>
> Jens Axboe (4):
> nfs: nfs_kill_super() should call bdi_unregister() after killing super
> writeback: don't use schedule_timeout() without setting runstate
> writeback: make balance_dirty_pages() gradually back more off
> nfs: initialize the backing_dev_info when creating the server
>
> fs/nfs/client.c | 10 ++++++----
> fs/nfs/super.c | 2 +-
> mm/page-writeback.c | 11 ++++++++++-
> 3 files changed, 17 insertions(+), 6 deletions(-)
just an update about the BDI slab corruption bugs i reported in this
thread on lkml:
[origin tree SLAB corruption] BUG kmalloc-64: Poison overwritten,
INFO: Allocated in bdi_alloc_work+0x2b/0x100 age=175 cpu=1 pid=3514
They have gone away entirely with your earlier BDI fixes/updates, on all
-tip testsystems that triggered it. So that bug can be closed for good.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] a few writeback fixes
2009-09-21 16:42 ` Ingo Molnar
@ 2009-09-21 19:02 ` Jens Axboe
0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2009-09-21 19:02 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Linus Torvalds, Linux Kernel, jack, fengguang.wu
On Mon, Sep 21 2009, Ingo Molnar wrote:
>
> * Jens Axboe <jens.axboe@oracle.com> wrote:
>
> > Hi Linus,
> >
> > This fixes a problem with NFS killing its bdi without being
> > initialized, and also contains a fix for a busy loop (where we forgot
> > to set the task state before sleeping). Since these are a bit critical
> > for -rc1, I'm pushing them out before leaving for Portland.
> >
> > Jan, since we're not really sure on the inode wait yet, I dropped that
> > patch. It's definitely something to look into, as are the congestion
> > bits.
> >
> > I plan on adding some writeback tracing code while on the plane for
> > further analysis when I get back.
> >
> > git://git.kernel.dk/linux-2.6-block.git writeback
> >
> > Jens Axboe (4):
> > nfs: nfs_kill_super() should call bdi_unregister() after killing super
> > writeback: don't use schedule_timeout() without setting runstate
> > writeback: make balance_dirty_pages() gradually back more off
> > nfs: initialize the backing_dev_info when creating the server
> >
> > fs/nfs/client.c | 10 ++++++----
> > fs/nfs/super.c | 2 +-
> > mm/page-writeback.c | 11 ++++++++++-
> > 3 files changed, 17 insertions(+), 6 deletions(-)
>
> just an update about the BDI slab corruption bugs i reported in this
> thread on lkml:
>
> [origin tree SLAB corruption] BUG kmalloc-64: Poison overwritten,
> INFO: Allocated in bdi_alloc_work+0x2b/0x100 age=175 cpu=1 pid=3514
>
> They have gone away entirely with your earlier BDI fixes/updates, on all
> -tip testsystems that triggered it. So that bug can be closed for good.
That's good, I was expecting Nicks fixes to resolve those. Thanks for
confirming!
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-09-21 19:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21 12:56 [GIT PULL] a few writeback fixes Jens Axboe
2009-09-21 13:08 ` Wu Fengguang
2009-09-21 13:11 ` Jan Kara
2009-09-21 13:41 ` Jens Axboe
2009-09-21 16:42 ` Ingo Molnar
2009-09-21 19:02 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox