summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_rtalloc.h
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-10-01 10:56:07 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-10-05 10:11:20 -0700
commitc4e53b74a3817bb9314b42066f327094f3fe05e8 (patch)
treec4bb565a5a71bd95ebd9802d4caead64ae7146d1 /fs/xfs/xfs_rtalloc.h
parent91d1d3d97e3316d0bd43cdce7cfa9171c687ebf5 (diff)
xfs: fix deadlock and streamline xfs_getfsmap performancegetfsmap-cleanups-5.10_2020-10-05
Refactor xfs_getfsmap to improve its performance: instead of indirectly calling a function that copies one record to userspace at a time, create a shadow buffer in the kernel and copy the whole array once at the end. On the author's computer, this reduces the runtime on his /home by ~20%. This also eliminates a deadlock when running GETFSMAP against the realtime device. The current code locks the rtbitmap to create fsmappings and copies them into userspace, having not released the rtbitmap lock. If the userspace buffer is an mmap of a sparse file that itself resides on the realtime device, the write page fault will recurse into the fs for allocation, which will deadlock on the rtbitmap lock. Fixes: 4c934c7dd60c ("xfs: report realtime space information via the rtbitmap") Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_rtalloc.h')
0 files changed, 0 insertions, 0 deletions