Page MenuHomeFreeBSD

tarfs: Implement VOP_BMAP
ClosedPublic

Authored by markj on Apr 3 2024, 9:37 PM.
Tags
None
Referenced Files
F167035796: D44626.diff
Tue, Aug 18, 4:55 PM
F167024319: D44626.id136567.diff
Tue, Aug 18, 3:49 PM
F167023793: D44626.id136538.diff
Tue, Aug 18, 3:47 PM
F167018375: D44626.id136567.diff
Tue, Aug 18, 3:04 PM
F166993042: D44626.id136502.diff
Tue, Aug 18, 11:00 AM
F166925681: D44626.diff
Mon, Aug 17, 7:46 PM
Unknown Object (File)
Sun, Aug 16, 9:27 PM
Unknown Object (File)
Sun, Aug 16, 7:11 PM
Subscribers

Details

Summary

This lets tarfs provide readahead/behind hints to the VFS, which helps
memory-mapped I/O performance, important when running faulting in
executables out of a tarfs mount as one might if tarfs is used to back
the root filesystem, for instance. This is particularly noticeable when
the backing tarball is zstd-compressed.

The implementation simply returns the extent of the virtual block
containing the target offset, clamped by the maximum I/O size. This is
perhaps simplistic; it effectively just chooses values that would
correspond to a single VOP_READ call in tarfs_read_file().

Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Apr 3 2024, 9:37 PM
sys/fs/tarfs/tarfs_vnops.c
147

Why not spell the type as u_unt?

172

Can we move the a_bnp calculation before the loop? Then I do not see the loop is needed if both a_runp and a_runb are NULL.

markj marked 2 inline comments as done.

Apply feedback from kib.

This revision is now accepted and ready to land.Apr 4 2024, 3:31 PM

BTW we never call bmap with runp NULL and runb non-NULL? Perhaps a debugpre hook for VOP_BMAP stating this would be due.

In D44626#1017623, @kib wrote:

BTW we never call bmap with runp NULL and runb non-NULL? Perhaps a debugpre hook for VOP_BMAP stating this would be due.

UFS makes this assumption too, and indeed I do not see any such callers.

This revision was automatically updated to reflect the committed changes.