diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-04-22 09:48:25 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-04-23 16:55:18 -0700 |
commit | c77b37584c2d1054452853e47e42c7350b8fe687 (patch) | |
tree | 1f7b650afee0f425d1fe653fccb4fe79e596566f /fs/affs/symlink.c | |
parent | be7cf174e908b1f350dd3ae4fbdf335f22af3273 (diff) | |
download | linux-c77b37584c2d1054452853e47e42c7350b8fe687.tar.gz linux-c77b37584c2d1054452853e47e42c7350b8fe687.tar.bz2 linux-c77b37584c2d1054452853e47e42c7350b8fe687.zip |
xfs: introduce vectored scrub mode
Introduce a variant on XFS_SCRUB_METADATA that allows for a vectored
mode. The caller specifies the principal metadata object that they want
to scrub (allocation group, inode, etc.) once, followed by an array of
scrub types they want called on that object. The kernel runs the scrub
operations and writes the output flags and errno code to the
corresponding array element.
A new pseudo scrub type BARRIER is introduced to force the kernel to
return to userspace if any corruptions have been found when scrubbing
the previous scrub types in the array. This enables userspace to
schedule, for example, the sequence:
1. data fork
2. barrier
3. directory
If the data fork scrub is clean, then the kernel will perform the
directory scrub. If not, the barrier in 2 will exit back to userspace.
The alternative would have been an interface where userspace passes a
pointer to an empty buffer, and the kernel formats that with
xfs_scrub_vecs that tell userspace what it scrubbed and what the outcome
was. With that the kernel would have to communicate that the buffer
needed to have been at least X size, even though for our cases
XFS_SCRUB_TYPE_NR + 2 would always be enough.
Compared to that, this design keeps all the dependency policy and
ordering logic in userspace where it already resides instead of
duplicating it in the kernel. The downside of that is that it needs the
barrier logic.
When running fstests in "rebuild all metadata after each test" mode, I
observed a 10% reduction in runtime due to fewer transitions across the
system call boundary.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/affs/symlink.c')
0 files changed, 0 insertions, 0 deletions