diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-03-30 11:25:51 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-04-20 03:59:25 -0400 |
commit | 5ac048bb7ea6e87b06504b999017cfa1f38f4092 (patch) | |
tree | 218a2dd0e6f6d39ead51bb32c10f801f6153c069 /fs/gfs2 | |
parent | 1027efaa238e1b65c07b6c2d9e270e548c2bdb07 (diff) |
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.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index 5b102c1887fd..3ebafa1efad0 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) | |||
91 | __releases(&sdp->sd_ail_lock) | 91 | __releases(&sdp->sd_ail_lock) |
92 | __acquires(&sdp->sd_ail_lock) | 92 | __acquires(&sdp->sd_ail_lock) |
93 | { | 93 | { |
94 | struct gfs2_glock *gl = NULL; | ||
94 | struct gfs2_bufdata *bd, *s; | 95 | struct gfs2_bufdata *bd, *s; |
95 | struct buffer_head *bh; | 96 | struct buffer_head *bh; |
96 | int retry; | 97 | int retry; |
@@ -113,19 +114,13 @@ __acquires(&sdp->sd_ail_lock) | |||
113 | 114 | ||
114 | if (!buffer_dirty(bh)) | 115 | if (!buffer_dirty(bh)) |
115 | continue; | 116 | continue; |
116 | 117 | if (gl == bd->bd_gl) | |
118 | continue; | ||
119 | gl = bd->bd_gl; | ||
117 | list_move(&bd->bd_ail_st_list, &ai->ai_ail1_list); | 120 | list_move(&bd->bd_ail_st_list, &ai->ai_ail1_list); |
118 | 121 | ||
119 | get_bh(bh); | ||
120 | spin_unlock(&sdp->sd_ail_lock); | 122 | spin_unlock(&sdp->sd_ail_lock); |
121 | lock_buffer(bh); | 123 | filemap_fdatawrite(gfs2_glock2aspace(gl)); |
122 | if (test_clear_buffer_dirty(bh)) { | ||
123 | bh->b_end_io = end_buffer_write_sync; | ||
124 | submit_bh(WRITE_SYNC, bh); | ||
125 | } else { | ||
126 | unlock_buffer(bh); | ||
127 | brelse(bh); | ||
128 | } | ||
129 | spin_lock(&sdp->sd_ail_lock); | 124 | spin_lock(&sdp->sd_ail_lock); |
130 | 125 | ||
131 | retry = 1; | 126 | retry = 1; |