diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-04-18 09:18:09 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-04-20 04:01:37 -0400 |
commit | 4667a0ec32867865fd4deccf834594b3ea831baf (patch) | |
tree | bff74fb13700e4087972fce94e45fd69dae7939b /fs/gfs2/super.c | |
parent | f42ab0852946c1fb5103682c5897eb3da908e4b0 (diff) |
GFS2: Make writeback more responsive to system conditions
This patch adds writeback_control to writing back the AIL
list. This means that we can then take advantage of the
information we get in ->write_inode() in order to set off
some pre-emptive writeback.
In addition, the AIL code is cleaned up a bit to make it
a bit simpler to understand.
There is still more which can usefully be done in this area,
but this is a good start at least.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/super.c')
-rw-r--r-- | fs/gfs2/super.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 215c37bfc2a4..58fe3a4ac829 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/time.h> | 23 | #include <linux/time.h> |
24 | #include <linux/wait.h> | 24 | #include <linux/wait.h> |
25 | #include <linux/writeback.h> | 25 | #include <linux/writeback.h> |
26 | #include <linux/backing-dev.h> | ||
26 | 27 | ||
27 | #include "gfs2.h" | 28 | #include "gfs2.h" |
28 | #include "incore.h" | 29 | #include "incore.h" |
@@ -714,6 +715,7 @@ static int gfs2_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
714 | struct gfs2_inode *ip = GFS2_I(inode); | 715 | struct gfs2_inode *ip = GFS2_I(inode); |
715 | struct gfs2_sbd *sdp = GFS2_SB(inode); | 716 | struct gfs2_sbd *sdp = GFS2_SB(inode); |
716 | struct address_space *metamapping = gfs2_glock2aspace(ip->i_gl); | 717 | struct address_space *metamapping = gfs2_glock2aspace(ip->i_gl); |
718 | struct backing_dev_info *bdi = metamapping->backing_dev_info; | ||
717 | struct gfs2_holder gh; | 719 | struct gfs2_holder gh; |
718 | struct buffer_head *bh; | 720 | struct buffer_head *bh; |
719 | struct timespec atime; | 721 | struct timespec atime; |
@@ -747,6 +749,8 @@ do_flush: | |||
747 | if (wbc->sync_mode == WB_SYNC_ALL) | 749 | if (wbc->sync_mode == WB_SYNC_ALL) |
748 | gfs2_log_flush(GFS2_SB(inode), ip->i_gl); | 750 | gfs2_log_flush(GFS2_SB(inode), ip->i_gl); |
749 | filemap_fdatawrite(metamapping); | 751 | filemap_fdatawrite(metamapping); |
752 | if (bdi->dirty_exceeded) | ||
753 | gfs2_ail1_flush(sdp, wbc); | ||
750 | if (!ret && (wbc->sync_mode == WB_SYNC_ALL)) | 754 | if (!ret && (wbc->sync_mode == WB_SYNC_ALL)) |
751 | ret = filemap_fdatawait(metamapping); | 755 | ret = filemap_fdatawait(metamapping); |
752 | if (ret) | 756 | if (ret) |
@@ -1366,7 +1370,8 @@ static int gfs2_dinode_dealloc(struct gfs2_inode *ip) | |||
1366 | if (error) | 1370 | if (error) |
1367 | goto out_rindex_relse; | 1371 | goto out_rindex_relse; |
1368 | 1372 | ||
1369 | error = gfs2_trans_begin(sdp, RES_RG_BIT + RES_STATFS + RES_QUOTA, 1); | 1373 | error = gfs2_trans_begin(sdp, RES_RG_BIT + RES_STATFS + RES_QUOTA, |
1374 | sdp->sd_jdesc->jd_blocks); | ||
1370 | if (error) | 1375 | if (error) |
1371 | goto out_rg_gunlock; | 1376 | goto out_rg_gunlock; |
1372 | 1377 | ||