diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2011-03-30 11:33:25 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2011-04-20 03:59:48 -0400 |
commit | 29687a2ac8dfcd5363e515ea715ec226aef8c26b (patch) | |
tree | a9bb35c110396c9c2a563c9442690cfb3368c8a8 /fs/gfs2/lops.c | |
parent | 5ac048bb7ea6e87b06504b999017cfa1f38f4092 (diff) |
GFS2: Alter point of entry to glock lru list for glocks with an address_space
Rather than allowing the glocks to be scheduled for possible
reclaim as soon as they have exited the journal, this patch
delays their entry to the list until the glocks in question
are no longer in use.
This means that we will rely on the vm for writeback of all
dirty data and metadata from now on. When glocks are added
to the lru list they should be freeable much faster since all
the I/O required to free them should have already been completed.
This should lead to much better I/O patterns under low memory
conditions.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/lops.c')
-rw-r--r-- | fs/gfs2/lops.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 51d27f00ebb4..611a51d476b2 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c | |||
@@ -40,7 +40,7 @@ static void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh) | |||
40 | { | 40 | { |
41 | struct gfs2_bufdata *bd; | 41 | struct gfs2_bufdata *bd; |
42 | 42 | ||
43 | gfs2_assert_withdraw(sdp, test_bit(SDF_JOURNAL_LIVE, &sdp->sd_flags)); | 43 | BUG_ON(!current->journal_info); |
44 | 44 | ||
45 | clear_buffer_dirty(bh); | 45 | clear_buffer_dirty(bh); |
46 | if (test_set_buffer_pinned(bh)) | 46 | if (test_set_buffer_pinned(bh)) |
@@ -65,6 +65,7 @@ static void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh) | |||
65 | * @sdp: the filesystem the buffer belongs to | 65 | * @sdp: the filesystem the buffer belongs to |
66 | * @bh: The buffer to unpin | 66 | * @bh: The buffer to unpin |
67 | * @ai: | 67 | * @ai: |
68 | * @flags: The inode dirty flags | ||
68 | * | 69 | * |
69 | */ | 70 | */ |
70 | 71 | ||
@@ -73,10 +74,8 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh, | |||
73 | { | 74 | { |
74 | struct gfs2_bufdata *bd = bh->b_private; | 75 | struct gfs2_bufdata *bd = bh->b_private; |
75 | 76 | ||
76 | gfs2_assert_withdraw(sdp, buffer_uptodate(bh)); | 77 | BUG_ON(!buffer_uptodate(bh)); |
77 | 78 | BUG_ON(!buffer_pinned(bh)); | |
78 | if (!buffer_pinned(bh)) | ||
79 | gfs2_assert_withdraw(sdp, 0); | ||
80 | 79 | ||
81 | lock_buffer(bh); | 80 | lock_buffer(bh); |
82 | mark_buffer_dirty(bh); | 81 | mark_buffer_dirty(bh); |
@@ -95,8 +94,7 @@ static void gfs2_unpin(struct gfs2_sbd *sdp, struct buffer_head *bh, | |||
95 | list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list); | 94 | list_add(&bd->bd_ail_st_list, &ai->ai_ail1_list); |
96 | spin_unlock(&sdp->sd_ail_lock); | 95 | spin_unlock(&sdp->sd_ail_lock); |
97 | 96 | ||
98 | if (test_and_clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags)) | 97 | clear_bit(GLF_LFLUSH, &bd->bd_gl->gl_flags); |
99 | gfs2_glock_schedule_for_reclaim(bd->bd_gl); | ||
100 | trace_gfs2_pin(bd, 0); | 98 | trace_gfs2_pin(bd, 0); |
101 | unlock_buffer(bh); | 99 | unlock_buffer(bh); |
102 | atomic_dec(&sdp->sd_log_pinned); | 100 | atomic_dec(&sdp->sd_log_pinned); |