Page MenuHomeFreeBSD

l2arc: make sure that all writes honor ashift of a cache device
ClosedPublic

Authored by avg on Jun 12 2015, 12:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 6:19 AM
Unknown Object (File)
Mar 22 2024, 6:45 PM
Unknown Object (File)
Mar 19 2024, 3:14 PM
Unknown Object (File)
Mar 19 2024, 3:07 PM
Unknown Object (File)
Feb 9 2024, 10:47 AM
Unknown Object (File)
Dec 22 2023, 9:27 PM
Unknown Object (File)
Dec 11 2023, 1:23 PM
Unknown Object (File)
Nov 12 2023, 3:54 AM

Details

Summary

Previously uncompressed buffers did not obey that rule.

Type of b_asize is changed to uint64_t for consistency,
given that this is a zeta-byte filesystem.

l2arc_compress_buf is renamed to l2arc_transform_buf to better reflect
its new utility. Now not only we ensure that a compressed buffer has
a size aligned to ashift, but we also allocate a properly sized
temporary buffer if the original buffer is not compressed and it has
an odd size. This ensures that all I/O to the cache device is always
ashift-aligned, in terms of both a request offset and a request size.

If the aligned data is larger than the original data, then we have to use
a temporary buffer when reading it as well.

Also, enhance physical zio alignment checks using vdev_logical_ashift.
On FreeBSD we have this information, so we can make stricter assertions.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avg retitled this revision from to l2arc: make sure that all writes honor ashift of a cache device.
avg edited the test plan for this revision. (Show Details)
avg updated this object.

Rebase after the recent massive imports from the upstream.
Plus the following small changes:

  • l2arc_transform_buf: tidy up the description
  • bump l2_compress_failures only if compression is actually requested
  • l2_padding_needed: count of uncompressed buffers that had to be padded
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
6576 ↗(On Diff #8097)

Logically we can assert rounded <= asize here but it's probably a good idea to use an explicit assertion here just in case?

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
6576 ↗(On Diff #8097)

I agree

  • arc_buf_l2_cdata_free: don't free b_tmp_cdata when l2hdr is not fully set up
  • l2arc: add a safety assertion
  • Merge branch 'master' into wip/l2arc-logical-ashift
  • arc_buf_l2_cdata_free: correct and simplify a comment
smh edited edge metadata.

One style(9) nit but otherwise this looks good to me.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
2741 ↗(On Diff #8859)

style(9) these should be split to two lines ideally.

This revision is now accepted and ready to land.Jan 11 2016, 11:14 AM
mav edited edge metadata.

Except couple very small things it looks good to me.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
6599 ↗(On Diff #8859)

... four possible outcomes:

6776 ↗(On Diff #8859)

While it is probably not fatal here, it is somewhat odd to check for some field validity after reading it.

This revision was automatically updated to reflect the committed changes.