Page MenuHomeFreeBSD

tarfs: Implement VOP_BMAP
ClosedPublic

Authored by markj on Apr 3 2024, 9:37 PM.
Tags
None
Referenced Files
F95779629: D44626.diff
Sun, Sep 22, 2:27 PM
Unknown Object (File)
Sun, Sep 22, 7:38 AM
Unknown Object (File)
Tue, Sep 17, 7:56 PM
Unknown Object (File)
Sun, Sep 8, 2:20 PM
Unknown Object (File)
Thu, Sep 5, 11:44 PM
Unknown Object (File)
Thu, Sep 5, 11:55 AM
Unknown Object (File)
Thu, Sep 5, 4:02 AM
Unknown Object (File)
Wed, Sep 4, 5:06 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 56914
Build 53802: arc lint + arc unit

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.