aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/lops.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-03-11 06:52:25 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2011-03-11 06:52:25 -0500
commitd6a079e82efd5fcbb1c7295f22e123c2cc748018 (patch)
treef95f3369dfb560bfc5d282577ca1edec0487e1d7 /fs/gfs2/lops.c
parente4a7b7b0c98efcdcc4c1f6eb10925dec1fbc4016 (diff)
GFS2: introduce AIL lock
The log lock is currently used to protect the AIL lists and the movements of buffers into and out of them. The lists are self contained and no log specific items outside the lists are accessed when starting or emptying the AIL lists. Hence the operation of the AIL does not require the protection of the log lock so split them out into a new AIL specific lock to reduce the amount of traffic on the log lock. This will also reduce the amount of serialisation that occurs when the gfs2_logd pushes on the AIL to move it forward. This reduces the impact of log pushing on sequential write throughput. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r--fs/gfs2/lops.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index 11a73efa8261..4295a6a0f1e4 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -80,7 +80,7 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
80 mark_buffer_dirty(bh); 80 mark_buffer_dirty(bh);
81 clear_buffer_pinned(bh); 81 clear_buffer_pinned(bh);
82 82
83 gfs2_log_lock(sdp); 83 spin_lock(&sdp->sd_ail_lock);
84 if (bd->bd_ail) { 84 if (bd->bd_ail) {
85 list_del(&bd->bd_ail_st_list); 85 list_del(&bd->bd_ail_st_list);
86 brelse(bh); 86 brelse(bh);
@@ -91,10 +91,11 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh,
91 } 91 }
92 bd->bd_ail = ai; 92 bd->bd_ail = ai;
93 list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list); 93 list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list);
94 spin_unlock(&sdp->sd_ail_lock);
95
94 if (test_and_clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags)) 96 if (test_and_clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags))
95 gfs2_glock_schedule_for_reclaim(bd->bd_gl); 97 gfs2_glock_schedule_for_reclaim(bd->bd_gl);
96 trace_gfs2_pin(bd, 0); 98 trace_gfs2_pin(bd, 0);
97 gfs2_log_unlock(sdp);
98 unlock_buffer(bh); 99 unlock_buffer(bh);
99 atomic_dec(&sdp->sd_log_pinned); 100 atomic_dec(&sdp->sd_log_pinned);
100} 101}