Skip to content

Commit 00dcd17

Browse files
Dave Chinnerdchinner
authored andcommitted
xfs: restore allocation trylock iteration
It was accidentally dropped when refactoring the allocation code, resulting in the AG iteration always doing blocking AG iteration. This results in a small performance regression for a specific fsmark test that runs more user data writer threads than there are AGs. Reported-by: kernel test robot <oliver.sang@intel.com> Fixes: 2edf06a ("xfs: factor xfs_alloc_vextent_this_ag() for _iterate_ags()") Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent 89a4bf0 commit 00dcd17

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3187,7 +3187,8 @@ xfs_alloc_vextent_check_args(
31873187
*/
31883188
static int
31893189
xfs_alloc_vextent_prepare_ag(
3190-
struct xfs_alloc_arg *args)
3190+
struct xfs_alloc_arg *args,
3191+
uint32_t flags)
31913192
{
31923193
bool need_pag = !args->pag;
31933194
int error;
@@ -3196,7 +3197,7 @@ xfs_alloc_vextent_prepare_ag(
31963197
args->pag = xfs_perag_get(args->mp, args->agno);
31973198

31983199
args->agbp = NULL;
3199-
error = xfs_alloc_fix_freelist(args, 0);
3200+
error = xfs_alloc_fix_freelist(args, flags);
32003201
if (error) {
32013202
trace_xfs_alloc_vextent_nofix(args);
32023203
if (need_pag)
@@ -3336,7 +3337,7 @@ xfs_alloc_vextent_this_ag(
33363337
return error;
33373338
}
33383339

3339-
error = xfs_alloc_vextent_prepare_ag(args);
3340+
error = xfs_alloc_vextent_prepare_ag(args, 0);
33403341
if (!error && args->agbp)
33413342
error = xfs_alloc_ag_vextent_size(args);
33423343

@@ -3380,7 +3381,7 @@ xfs_alloc_vextent_iterate_ags(
33803381
for_each_perag_wrap_range(mp, start_agno, restart_agno,
33813382
mp->m_sb.sb_agcount, agno, args->pag) {
33823383
args->agno = agno;
3383-
error = xfs_alloc_vextent_prepare_ag(args);
3384+
error = xfs_alloc_vextent_prepare_ag(args, flags);
33843385
if (error)
33853386
break;
33863387
if (!args->agbp) {
@@ -3546,7 +3547,7 @@ xfs_alloc_vextent_exact_bno(
35463547
return error;
35473548
}
35483549

3549-
error = xfs_alloc_vextent_prepare_ag(args);
3550+
error = xfs_alloc_vextent_prepare_ag(args, 0);
35503551
if (!error && args->agbp)
35513552
error = xfs_alloc_ag_vextent_exact(args);
35523553

@@ -3587,7 +3588,7 @@ xfs_alloc_vextent_near_bno(
35873588
if (needs_perag)
35883589
args->pag = xfs_perag_grab(mp, args->agno);
35893590

3590-
error = xfs_alloc_vextent_prepare_ag(args);
3591+
error = xfs_alloc_vextent_prepare_ag(args, 0);
35913592
if (!error && args->agbp)
35923593
error = xfs_alloc_ag_vextent_near(args);
35933594

0 commit comments

Comments
 (0)