aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2011-03-30 16:25:51 +0100
committerSteven Whitehouse <swhiteho@redhat.com>2011-04-20 08:59:25 +0100
commit5ac048bb7ea6e87b06504b999017cfa1f38f4092 (patch)
tree218a2dd0e6f6d39ead51bb32c10f801f6153c069 /fs/gfs2
parent1027efaa238e1b65c07b6c2d9e270e548c2bdb07 (diff)
downloadkernel_samsung_smdk4412-5ac048bb7ea6e87b06504b999017cfa1f38f4092.zip
kernel_samsung_smdk4412-5ac048bb7ea6e87b06504b999017cfa1f38f4092.tar.gz
kernel_samsung_smdk4412-5ac048bb7ea6e87b06504b999017cfa1f38f4092.tar.bz2
GFS2: Use filemap_fdatawrite() to write back the AIL
In order to ensure that the mapping stats (and thus the bdi) are correctly updated, this patch changes the AIL writeback to use the filemap_datawrite function. This helps prevent stalls in balance_dirty_pages() due to large amounts of dirty metadata when there is little or no dirty data around. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/log.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 5b102c1..3ebafa1 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -91,6 +91,7 @@ static void gfs2_ail1_start_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai)
__releases(&sdp->sd_ail_lock)
__acquires(&sdp->sd_ail_lock)
{
+ struct gfs2_glock *gl = NULL;
struct gfs2_bufdata *bd, *s;
struct buffer_head *bh;
int retry;
@@ -113,19 +114,13 @@ __acquires(&sdp->sd_ail_lock)
if (!buffer_dirty(bh))
continue;
-
+ if (gl == bd->bd_gl)
+ continue;
+ gl = bd->bd_gl;
list_move(&bd->bd_ail_st_list, &ai->ai_ail1_list);
- get_bh(bh);
spin_unlock(&sdp->sd_ail_lock);
- lock_buffer(bh);
- if (test_clear_buffer_dirty(bh)) {
- bh->b_end_io = end_buffer_write_sync;
- submit_bh(WRITE_SYNC, bh);
- } else {
- unlock_buffer(bh);
- brelse(bh);
- }
+ filemap_fdatawrite(gfs2_glock2aspace(gl));
spin_lock(&sdp->sd_ail_lock);
retry = 1;