summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_extfree_item.h
diff options
context:
space:
mode:
authorDarrick J. Wong2019-07-05 19:29:56 +0200
committerDarrick J. Wong2019-07-05 19:29:56 +0200
commit6d6ccedd76823c28115bd6925342ceb73bab6cd4 (patch)
tree36366452bf5bf8a5dbc9b5b9d2371791444b72c4 /fs/xfs/xfs_extfree_item.h
parentxfs: refactor attr scrub memory allocation function (diff)
downloadkernel-qcow2-linux-6d6ccedd76823c28115bd6925342ceb73bab6cd4.tar.gz
kernel-qcow2-linux-6d6ccedd76823c28115bd6925342ceb73bab6cd4.tar.xz
kernel-qcow2-linux-6d6ccedd76823c28115bd6925342ceb73bab6cd4.zip
xfs: only allocate memory for scrubbing attributes when we need it
In examining a flame graph of time spent running xfs_scrub on various filesystems, I noticed that we spent nearly 7% of the total runtime on allocating a zeroed 65k buffer for every SCRUB_TYPE_XATTR invocation. We do this even if none of the attribute values were anywhere near 64k in size, even if there were no attribute blocks to check space on, and even if it just turns out there are no attributes at all. Therefore, rearrange the xattr buffer setup code to support reallocating with a bigger buffer and redistribute the callers of that function so that we only allocate memory just prior to needing it, and only allocate as much as we need. If we can't get memory with the ILOCK held we'll bail out with EDEADLOCK which will allocate the maximum memory. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_extfree_item.h')
0 files changed, 0 insertions, 0 deletions