freebsd-dev/sys/cddl/contrib/opensolaris/uts/common/fs
Andriy Gapon 6470c31911 l2arc: pass correct size to trim requests
b_size is a logical size of a buffer in memory, b_asize is its physical
size that accounts for possible compression.
Currently the latter is the best approximation for the allocated, on-disk
size.

L2ARC TRIM support was committed a few weeks before L2ARC compression
was imported, so originally the code was correct, because b_size was
the size.

Further thoughts.  Given that the cache device is being overwritten
in a circular fashion it is not clear if a TRIM per each evicted L2ARC
buffer has any benefits.
Maybe it would be sufficient to issue a single trim request for the whole
device when it is loaded, e.g. after a bootup, or when it is unloaded, e.g.
before a shutdown.  At least as long as L2ARC is not persistent across
reboots.

Discussed with:	smh
MFC after:	19 says
2015-06-17 12:28:13 +00:00
..
zfs l2arc: pass correct size to trim requests 2015-06-17 12:28:13 +00:00
gfs.c Use the "zfs_gfs" tag for GFS vnodes to make them easier to identify. 2015-01-20 22:31:26 +00:00
vnode.c