aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-04-24 15:06:15 -0400
committerAlex Elder <aelder@sgi.com>2011-04-28 14:18:01 -0400
commite26f0501cf743a4289603501413f97ffcb4612f2 (patch)
tree6327f071c53ddb494d59ce04b3cf8a760aceb987 /fs/xfs/linux-2.6
parenta870acd9b2671de56514a430edfa7867823c31c9 (diff)
xfs: do not immediately reuse busy extent ranges
Every time we reallocate a busy extent, we cause a synchronous log force to occur to ensure the freeing transaction is on disk before we continue and use the newly allocated extent. This is extremely sub-optimal as we have to mark every transaction with blocks that get reused as synchronous. Instead of searching the busy extent list after deciding on the extent to allocate, check each candidate extent during the allocation decisions as to whether they are in the busy list. If they are in the busy list, we trim the busy range out of the extent we have found and determine if that trimmed range is still OK for allocation. In many cases, this check can be incorporated into the allocation extent alignment code which already does trimming of the found extent before determining if it is a valid candidate for allocation. Based on earlier patches from Dave Chinner. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_trace.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h
index 2d0bcb479075..e5252c4d95c9 100644
--- a/fs/xfs/linux-2.6/xfs_trace.h
+++ b/fs/xfs/linux-2.6/xfs_trace.h
@@ -1241,6 +1241,36 @@ TRACE_EVENT(xfs_alloc_busysearch,
1241 __print_symbolic(__entry->found, XFS_BUSY_STATES)) 1241 __print_symbolic(__entry->found, XFS_BUSY_STATES))
1242); 1242);
1243 1243
1244TRACE_EVENT(xfs_alloc_busy_trim,
1245 TP_PROTO(struct xfs_mount *mp, xfs_agnumber_t agno,
1246 xfs_agblock_t agbno, xfs_extlen_t len,
1247 xfs_agblock_t tbno, xfs_extlen_t tlen),
1248 TP_ARGS(mp, agno, agbno, len, tbno, tlen),
1249 TP_STRUCT__entry(
1250 __field(dev_t, dev)
1251 __field(xfs_agnumber_t, agno)
1252 __field(xfs_agblock_t, agbno)
1253 __field(xfs_extlen_t, len)
1254 __field(xfs_agblock_t, tbno)
1255 __field(xfs_extlen_t, tlen)
1256 ),
1257 TP_fast_assign(
1258 __entry->dev = mp->m_super->s_dev;
1259 __entry->agno = agno;
1260 __entry->agbno = agbno;
1261 __entry->len = len;
1262 __entry->tbno = tbno;
1263 __entry->tlen = tlen;
1264 ),
1265 TP_printk("dev %d:%d agno %u agbno %u len %u tbno %u tlen %u",
1266 MAJOR(__entry->dev), MINOR(__entry->dev),
1267 __entry->agno,
1268 __entry->agbno,
1269 __entry->len,
1270 __entry->tbno,
1271 __entry->tlen)
1272);
1273
1244TRACE_EVENT(xfs_trans_commit_lsn, 1274TRACE_EVENT(xfs_trans_commit_lsn,
1245 TP_PROTO(struct xfs_trans *trans), 1275 TP_PROTO(struct xfs_trans *trans),
1246 TP_ARGS(trans), 1276 TP_ARGS(trans),
@@ -1433,11 +1463,14 @@ DEFINE_ALLOC_EVENT(xfs_alloc_near_first);
1433DEFINE_ALLOC_EVENT(xfs_alloc_near_greater); 1463DEFINE_ALLOC_EVENT(xfs_alloc_near_greater);
1434DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser); 1464DEFINE_ALLOC_EVENT(xfs_alloc_near_lesser);
1435DEFINE_ALLOC_EVENT(xfs_alloc_near_error); 1465DEFINE_ALLOC_EVENT(xfs_alloc_near_error);
1466DEFINE_ALLOC_EVENT(xfs_alloc_near_noentry);
1467DEFINE_ALLOC_EVENT(xfs_alloc_near_busy);
1436DEFINE_ALLOC_EVENT(xfs_alloc_size_neither); 1468DEFINE_ALLOC_EVENT(xfs_alloc_size_neither);
1437DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry); 1469DEFINE_ALLOC_EVENT(xfs_alloc_size_noentry);
1438DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft); 1470DEFINE_ALLOC_EVENT(xfs_alloc_size_nominleft);
1439DEFINE_ALLOC_EVENT(xfs_alloc_size_done); 1471DEFINE_ALLOC_EVENT(xfs_alloc_size_done);
1440DEFINE_ALLOC_EVENT(xfs_alloc_size_error); 1472DEFINE_ALLOC_EVENT(xfs_alloc_size_error);
1473DEFINE_ALLOC_EVENT(xfs_alloc_size_busy);
1441DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist); 1474DEFINE_ALLOC_EVENT(xfs_alloc_small_freelist);
1442DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough); 1475DEFINE_ALLOC_EVENT(xfs_alloc_small_notenough);
1443DEFINE_ALLOC_EVENT(xfs_alloc_small_done); 1476DEFINE_ALLOC_EVENT(xfs_alloc_small_done);