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)
Sat, May 4, 12:54 PM
Unknown Object (File)
Tue, Apr 30, 11:32 AM
Unknown Object (File)
Mon, Apr 29, 7:48 AM
Unknown Object (File)
Sun, Apr 28, 3:12 PM
Unknown Object (File)
Sun, Apr 28, 2:59 PM
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

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
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 574
Build 574: arc lint + arc unit

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
6589–6590

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
6589–6590

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–2744

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
6544–6545

... four possible outcomes:

6720

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.