HomeFreeBSD

Detect and optimize reads from the hole on UFS.

Description

Detect and optimize reads from the hole on UFS.

  • Create getblkx(9) variant of getblk(9) which can return error.
  • Add GB_NOSPARSE flag for getblk()/getblkx() which requests that BMAP was performed before the buffer is created, and EJUSTRETURN returned in case the requested block does not exist.
  • Make ffs_read() use GB_NOSPARSE to avoid instantiating buffer (and allocating the pages for it), copying from zero_region instead.

The end result is less page allocations and buffer recycling when a
hole is read, which is important for some benchmarks.

Requested and reviewed by: jeff
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D14917

Details

Provenance
kibAuthored on
Differential Revision
D14917: Detect reads from the hole.
Parents
rS333575: hwpmc/epoch - don't reference domain if NUMA is not set
Branches
Unknown
Tags
Unknown