From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH v3 3/4] xfs: randomly fall back to near mode lookup algorithm in debug mode
Date: Thu, 15 Aug 2019 08:55:37 -0400 [thread overview]
Message-ID: <20190815125538.49570-4-bfoster@redhat.com> (raw)
In-Reply-To: <20190815125538.49570-1-bfoster@redhat.com>
The last block scan is the dominant near mode allocation algorithm
for a newer filesystem with fewer, large free extents. Add debug
mode logic to randomly fall back to lookup mode to improve
regression test coverage.
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
fs/xfs/libxfs/xfs_alloc.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index 7753b61ba532..d550aa5597bf 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -1266,6 +1266,7 @@ xfs_alloc_ag_vextent_near(
int i;
xfs_agblock_t bno;
xfs_extlen_t len;
+ bool lastblock;
/* handle unitialized agbno range so caller doesn't have to */
if (!args->min_agbno && !args->max_agbno)
@@ -1291,7 +1292,12 @@ xfs_alloc_ag_vextent_near(
* Otherwise run the optimized lookup search algorithm from the current
* location to the end of the tree.
*/
- if (xfs_btree_islastblock(acur.cnt, 0)) {
+ lastblock = xfs_btree_islastblock(acur.cnt, 0);
+#ifdef DEBUG
+ if (lastblock)
+ lastblock = prandom_u32() & 1;
+#endif
+ if (lastblock) {
int j;
trace_xfs_alloc_cur_lastblock(args);
--
2.20.1
next prev parent reply other threads:[~2019-08-15 12:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-15 12:55 [PATCH v3 0/4] xfs: rework near mode extent allocation Brian Foster
2019-08-15 12:55 ` [PATCH v3 1/4] xfs: track active state of allocation btree cursors Brian Foster
2019-08-17 0:51 ` Darrick J. Wong
2019-08-19 18:03 ` Brian Foster
2019-08-15 12:55 ` [PATCH v3 2/4] xfs: use locality optimized cntbt lookups for near mode allocations Brian Foster
2019-08-17 1:34 ` Darrick J. Wong
2019-08-19 18:06 ` Brian Foster
2019-08-15 12:55 ` Brian Foster [this message]
2019-08-17 1:37 ` [PATCH v3 3/4] xfs: randomly fall back to near mode lookup algorithm in debug mode Darrick J. Wong
2019-08-19 18:19 ` Brian Foster
2019-08-15 12:55 ` [PATCH v3 4/4] xfs: refactor successful AG allocation accounting code Brian Foster
2019-08-17 0:28 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190815125538.49570-4-bfoster@redhat.com \
--to=bfoster@redhat.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox