HomeFreeBSD

dmu_zfetch: don't leak unreferenced stream when zfetch is freed

Description

dmu_zfetch: don't leak unreferenced stream when zfetch is freed

Currently streams are only freed when:

  • They have no referencing zfetch and and their I/O references go to zero.
  • They are more than 2s old and a new I/O request comes in on the same zfetch.

This means that we will leak unreferenced streams when their zfetch
structure is freed.

This change checks the reference count on a stream at zfetch free
time. If it is zero we free it immediately. If it has remaining
references we allow the prefetch callback to free it at I/O
completion time.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Adam Moss <c@yotes.com>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #11052

Details

Provenance
mmacyAuthored on Oct 14 2020, 4:03 AM
GitHub <noreply@github.com>Committed on Oct 14 2020, 4:03 AM
Parents
rG6ba2e72b7899: aarch64: Use proper guards for NEON instructions
Branches
Unknown
Tags
Unknown