* [PATCH 2/2] Restore the lowspace extent allocator algorithm
@ 2008-06-24 2:16 Lachlan McIlroy
2008-06-24 5:00 ` Dave Chinner
0 siblings, 1 reply; 2+ messages in thread
From: Lachlan McIlroy @ 2008-06-24 2:16 UTC (permalink / raw)
To: xfs-dev, xfs-oss
When free space is running low the extent allocator may choose to
allocate an extent from an AG without leaving sufficient space for
a btree split when inserting the new extent (see where
xfs_bmap_btalloc() sets minleft to 0). In this case the allocator
will enable the lowspace algorithm which is supposed to allow further
allocations (such as btree splits and newroots) to allocate from
sequential AGs. This algorithm has been broken for a long time
and this patch restores its behaviour.
Lachlan
--- 2.6.x-agno2.orig/fs/xfs/xfs_bmap_btree.c
+++ 2.6.x-agno2/fs/xfs/xfs_bmap_btree.c
@@ -1504,7 +1504,9 @@ xfs_bmbt_split(
* we may need space for two tree splits.
*/
args.minleft = xfs_trans_get_block_res(args.tp);
- } else
+ } else if (cur->bc_private.b.flist->xbf_low)
+ args.type = XFS_ALLOCTYPE_START_BNO;
+ else
args.type = XFS_ALLOCTYPE_NEAR_BNO;
args.mod = args.alignment = args.total = args.isfl =
args.userdata = args.minalignslop = 0;
@@ -2232,7 +2234,9 @@ xfs_bmbt_newroot(
#endif
args.fsbno = be64_to_cpu(*pp);
args.type = XFS_ALLOCTYPE_START_BNO;
- } else
+ } else if (cur->bc_private.b.flist->xbf_low)
+ args.type = XFS_ALLOCTYPE_START_BNO;
+ else
args.type = XFS_ALLOCTYPE_NEAR_BNO;
if ((error = xfs_alloc_vextent(&args))) {
XFS_BMBT_TRACE_CURSOR(cur, ERROR);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 2/2] Restore the lowspace extent allocator algorithm
2008-06-24 2:16 [PATCH 2/2] Restore the lowspace extent allocator algorithm Lachlan McIlroy
@ 2008-06-24 5:00 ` Dave Chinner
0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2008-06-24 5:00 UTC (permalink / raw)
To: Lachlan McIlroy; +Cc: xfs-dev, xfs-oss
On Tue, Jun 24, 2008 at 12:16:19PM +1000, Lachlan McIlroy wrote:
> When free space is running low the extent allocator may choose to
> allocate an extent from an AG without leaving sufficient space for
> a btree split when inserting the new extent (see where
> xfs_bmap_btalloc() sets minleft to 0). In this case the allocator
> will enable the lowspace algorithm which is supposed to allow further
> allocations (such as btree splits and newroots) to allocate from
> sequential AGs. This algorithm has been broken for a long time
> and this patch restores its behaviour.
Looks ok to me. Perhaps add a comment to the definition of
xbf_low that explains what it is used for so it doesn't
get broken again in future?
Cheers,
Dave.
--
Dave Chinner
dchinner@agami.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-24 4:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24 2:16 [PATCH 2/2] Restore the lowspace extent allocator algorithm Lachlan McIlroy
2008-06-24 5:00 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox