aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2014-02-03 04:57:29 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2014-02-03 04:57:29 -0500
commit885bceca7ff12021c9c17f58d12e12ec6e8e59a6 (patch)
tree3e0b43c2efc2856f2c8d1b1505fc496581b2f41d /fs/gfs2
parent38dbfb59d1175ef458d006556061adeaa8751b72 (diff)
GFS2: Plug on AIL flush
When we do a flush of the AIL list, we are writing out what is likely to be a lot of small I/Os, which are possibly in an order which is not ideal performance-wise. Since this is done by calling filemap_fdatatwrite for each individual inode's address space there is no overall plugging going on. In addition to that, we do not always wait for AIL i/o when we flush it, so that it is possible for things to get left behind on the queue. By adding explicit plugging here, we reduce the chances of this being an issues. A quick test using the AIL flush tracepoint shows a small, but measurable improvement. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/log.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 9dcb9777a5f8..1e1bda0de43d 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -18,6 +18,7 @@
18#include <linux/kthread.h> 18#include <linux/kthread.h>
19#include <linux/freezer.h> 19#include <linux/freezer.h>
20#include <linux/bio.h> 20#include <linux/bio.h>
21#include <linux/blkdev.h>
21#include <linux/writeback.h> 22#include <linux/writeback.h>
22#include <linux/list_sort.h> 23#include <linux/list_sort.h>
23 24
@@ -145,8 +146,10 @@ void gfs2_ail1_flush(struct gfs2_sbd *sdp, struct writeback_control *wbc)
145{ 146{
146 struct list_head *head = &sdp->sd_ail1_list; 147 struct list_head *head = &sdp->sd_ail1_list;
147 struct gfs2_trans *tr; 148 struct gfs2_trans *tr;
149 struct blk_plug plug;
148 150
149 trace_gfs2_ail_flush(sdp, wbc, 1); 151 trace_gfs2_ail_flush(sdp, wbc, 1);
152 blk_start_plug(&plug);
150 spin_lock(&sdp->sd_ail_lock); 153 spin_lock(&sdp->sd_ail_lock);
151restart: 154restart:
152 list_for_each_entry_reverse(tr, head, tr_list) { 155 list_for_each_entry_reverse(tr, head, tr_list) {
@@ -156,6 +159,7 @@ restart:
156 goto restart; 159 goto restart;
157 } 160 }
158 spin_unlock(&sdp->sd_ail_lock); 161 spin_unlock(&sdp->sd_ail_lock);
162 blk_finish_plug(&plug);
159 trace_gfs2_ail_flush(sdp, wbc, 0); 163 trace_gfs2_ail_flush(sdp, wbc, 0);
160} 164}
161 165