From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 07/10] repair: BMBT prefetch needs to be CRC aware
Date: Thu, 27 Feb 2014 20:51:12 +1100 [thread overview]
Message-ID: <1393494675-30194-8-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1393494675-30194-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
I'd been trying to track down a behavioural difference between
non-crc and crc enabled filesystems that was resulting non-crc
filesystem executing prefetch almost 3x faster than CRC filesystems.
After amny ratholes, I finally stumbled on the fact that btree
format directories are not being prefetched due to a missing magic
number check, and it's rejecting all XFS_BMAP_CRC_MAGIC format BMBT
buffers. This makes prefetch on CRC enabled filesystems behave the
same as for non-CRC filesystems.
The difference a single line of code can make on a 50 million inode
filesystem with a single threaded prefetch enabled run is pretty
amazing. It goes from 3,000 iops @ 50MB/s to 2,000 IOPS @ 800MB/s
and the cache hit rate goes from 3% to 49%. The runtime difference:
Unpatched:
Phase Start End Duration
Phase 1: 02/21 18:34:12 02/21 18:34:12
Phase 2: 02/21 18:34:12 02/21 18:34:15 3 seconds
Phase 3: 02/21 18:34:15 02/21 18:40:09 5 minutes, 54 seconds
Phase 4: 02/21 18:40:09 02/21 18:46:36 6 minutes, 27 seconds
Phase 5: 02/21 18:46:36 02/21 18:46:37 1 second
Phase 6: 02/21 18:46:37 02/21 18:52:51 6 minutes, 14 seconds
Phase 7: 02/21 18:52:51 02/21 18:52:52 1 second
Total run time: 18 minutes, 40 seconds
Patched:
Phase Start End Duration
Phase 1: 02/21 19:58:23 02/21 19:58:23
Phase 2: 02/21 19:58:23 02/21 19:58:27 4 seconds
Phase 3: 02/21 19:58:27 02/21 19:59:20 53 seconds
Phase 4: 02/21 19:59:20 02/21 20:00:07 47 seconds
Phase 5: 02/21 20:00:07 02/21 20:00:08 1 second
Phase 6: 02/21 20:00:08 02/21 20:00:50 42 seconds
Phase 7: 02/21 20:00:50 02/21 20:00:50
Total run time: 2 minutes, 27 seconds
Is no less impressive. Shame it's just a regression fix. ;)
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
repair/prefetch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/repair/prefetch.c b/repair/prefetch.c
index f4f3d71..946e822 100644
--- a/repair/prefetch.c
+++ b/repair/prefetch.c
@@ -298,7 +298,8 @@ pf_scanfunc_bmap(
/*
* do some validation on the block contents
*/
- if ((be32_to_cpu(block->bb_magic) != XFS_BMAP_MAGIC) ||
+ if ((block->bb_magic != cpu_to_be32(XFS_BMAP_MAGIC) &&
+ block->bb_magic != cpu_to_be32(XFS_BMAP_CRC_MAGIC)) ||
(be16_to_cpu(block->bb_level) != level))
return 0;
--
1.8.4.rc3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-02-27 9:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 9:51 [PATCH 00/10, v3] xfsprogs: reapir scalability and fixes Dave Chinner
2014-02-27 9:51 ` [PATCH 01/10] repair: translation lookups limit scalability Dave Chinner
2014-02-27 9:51 ` [PATCH 02/10] repair: per AG locks contend for cachelines Dave Chinner
2014-02-27 9:51 ` [PATCH 03/10] libxfs: buffer cache hashing is suboptimal Dave Chinner
2014-02-27 9:51 ` [PATCH 04/10] repair: limit auto-striding concurrency apprpriately Dave Chinner
2014-02-27 9:51 ` [PATCH 05/10] repair: use a listhead for the dotdot list Dave Chinner
2014-02-27 9:51 ` [PATCH 06/10] repair: fix prefetch queue limiting Dave Chinner
2014-02-27 9:51 ` Dave Chinner [this message]
2014-02-27 9:51 ` [PATCH 08/10] repair: factor out threading setup code Dave Chinner
2014-02-27 14:05 ` Brian Foster
2014-02-27 9:51 ` [PATCH 09/10] repair: prefetch runs too far ahead Dave Chinner
2014-02-27 14:08 ` Brian Foster
2014-02-27 20:01 ` Dave Chinner
2014-02-27 20:24 ` Dave Chinner
2014-02-27 20:45 ` Brian Foster
2014-02-27 9:51 ` [PATCH 10/10] libxfs: remove a couple of locks Dave Chinner
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=1393494675-30194-8-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.