HomeFreeBSD

MFC r322239: MFV r322238: 7915 checks in l2arc_evict could use some cleaning up

Description

MFC r322239: MFV r322238: 7915 checks in l2arc_evict could use some cleaning up

illumos/illumos-gate@267ae6c3a88d2fc39276af66caafa978b0935b82
https://github.com/illumos/illumos-gate/commit/267ae6c3a88d2fc39276af66caafa978b0935b82

https://www.illumos.org/issues/7915

l2arc_evict() is strictly serialized with respect to
l2arc_write_buffers() and l2arc_write_done().  Normally, l2arc_evict()
and l2arc_write_buffers() are called from the same thread, so they can
not be concurrent.  Also, l2arc_write_buffers() uses zio_wait() on the
parent zio of all cache zio-s.  That ensures that l2arc_write_done()
is completed before l2arc_write_buffers() returns.  Finally, if a
cache device is removed, then l2arc_evict() is called under SCL_ALL in
the exclusive mode.  That ensures that it can not be concurrent with
the normal L2ARC accesses to the device (including writing and
evicting buffers).  Given the above, some checks and actions in
l2arc_evict() do not make sense.  For instance, it must never
encounter the write head header let alone remove it from the buffer
list.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Andriy Gapon <avg@FreeBSD.org>

Details

Provenance
avgAuthored on
Reviewer
matthew
Parents
rS323751: MFC r322218: MFV r322217: 8418 zfs_prop_get_table() call in zfs_validate_name()…
Branches
Unknown
Tags
Unknown