summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-06-23 14:27:23 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-06-26 13:01:57 -0700
commitcfda09de94739559a7bea8225e643a83684edbec (patch)
tree90e7f6c4c1e2add8ad036d0a203904060b8e07ca
parenta21442434834072ae12b9f9699af780893b11031 (diff)
xfs: online scrub needn't bother zeroing its temporary bufferattr-scrub-fixes_2019-06-26
The xattr scrubber functions use the temporary memory buffer either for storing bitmaps or for testing if attribute value extraction works. The bitmap code always zeroes what it needs and the value extraction merely sets the buffer contents (we never read the contents, we just look for return codes), so it's not necessary to waste CPU time zeroing on allocation. A flame graph analysis showed that we were spending 7% of a xfs_scrub run (the whole program, not just the attr scrubber itself) allocating and zeroing 64k segments needlessly. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
-rw-r--r--fs/xfs/scrub/attr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index 09081d8ab34b..d3a6f3dacf0d 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -64,7 +64,12 @@ xchk_setup_xattr_buf(
sc->buf = NULL;
}
- ab = kmem_zalloc_large(sizeof(*ab) + sz, flags);
+ /*
+ * Allocate the big buffer. We skip zeroing it because that added 7%
+ * to the scrub runtime and all the users were careful never to read
+ * uninitialized contents.
+ */
+ ab = kmem_alloc_large(sizeof(*ab) + sz, flags);
if (!ab)
return -ENOMEM;