Commit 58e75a09 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'writeback' of git://git.kernel.dk/linux-2.6-block

* 'writeback' of git://git.kernel.dk/linux-2.6-block:
  nfs: initialize the backing_dev_info when creating the server
  writeback: make balance_dirty_pages() gradually back more off
  writeback: don't use schedule_timeout() without setting runstate
  nfs: nfs_kill_super() should call bdi_unregister() after killing super
parents c720f565 48d07649
...@@ -933,10 +933,6 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str ...@@ -933,10 +933,6 @@ static int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, str
goto out_error; goto out_error;
nfs_server_set_fsinfo(server, &fsinfo); nfs_server_set_fsinfo(server, &fsinfo);
error = bdi_init(&server->backing_dev_info);
if (error)
goto out_error;
/* Get some general file system info */ /* Get some general file system info */
if (server->namelen == 0) { if (server->namelen == 0) {
...@@ -995,6 +991,12 @@ static struct nfs_server *nfs_alloc_server(void) ...@@ -995,6 +991,12 @@ static struct nfs_server *nfs_alloc_server(void)
return NULL; return NULL;
} }
if (bdi_init(&server->backing_dev_info)) {
nfs_free_iostats(server->io_stats);
kfree(server);
return NULL;
}
return server; return server;
} }
......
...@@ -2190,8 +2190,8 @@ static void nfs_kill_super(struct super_block *s) ...@@ -2190,8 +2190,8 @@ static void nfs_kill_super(struct super_block *s)
{ {
struct nfs_server *server = NFS_SB(s); struct nfs_server *server = NFS_SB(s);
bdi_unregister(&server->backing_dev_info);
kill_anon_super(s); kill_anon_super(s);
bdi_unregister(&server->backing_dev_info);
nfs_fscache_release_super_cookie(s); nfs_fscache_release_super_cookie(s);
nfs_free_server(server); nfs_free_server(server);
} }
......
...@@ -485,6 +485,7 @@ static void balance_dirty_pages(struct address_space *mapping) ...@@ -485,6 +485,7 @@ static void balance_dirty_pages(struct address_space *mapping)
unsigned long bdi_thresh; unsigned long bdi_thresh;
unsigned long pages_written = 0; unsigned long pages_written = 0;
unsigned long write_chunk = sync_writeback_pages(); unsigned long write_chunk = sync_writeback_pages();
unsigned long pause = 1;
struct backing_dev_info *bdi = mapping->backing_dev_info; struct backing_dev_info *bdi = mapping->backing_dev_info;
...@@ -561,7 +562,15 @@ static void balance_dirty_pages(struct address_space *mapping) ...@@ -561,7 +562,15 @@ static void balance_dirty_pages(struct address_space *mapping)
if (pages_written >= write_chunk) if (pages_written >= write_chunk)
break; /* We've done our duty */ 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 && if (bdi_nr_reclaimable + bdi_nr_writeback < bdi_thresh &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment