summaryrefslogtreecommitdiff
path: root/kernel/rseq.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-06-23 09:34:30 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2019-06-26 13:01:57 -0700
commita21442434834072ae12b9f9699af780893b11031 (patch)
tree0f5e39c85dabe205d2313e9f14dced28a90257d0 /kernel/rseq.c
parent1cfde3fcb959954e8f6c927aa69c73518bd6f627 (diff)
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>
Diffstat (limited to 'kernel/rseq.c')
0 files changed, 0 insertions, 0 deletions