]> git.proxmox.com Git - mirror_zfs.git/commit
System-wide speculative prefetch limit.
authorAlexander Motin <mav@FreeBSD.org>
Wed, 1 Mar 2023 23:27:40 +0000 (18:27 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 2 Mar 2023 22:37:07 +0000 (14:37 -0800)
commit9d2e5c14b2f94c91aa389799bd9e80e1098263e7
tree7854f85e197faf3d2773bb94ab9201112cf7401b
parentb644a45bd4cdc9951887dc3766c7fdcde4d638b6
System-wide speculative prefetch limit.

With some pathological access patterns it is possible to make ZFS
accumulate almost unlimited amount of speculative prefetch ZIOs.
Combined with linear ABD allocations in RAIDZ code, it appears to
be possible to exhaust system KVA, triggering kernel panic.

Address this by introducing a system-wide counter of active prefetch
requests and blocking prefetch distance doubling per stream hits if
the number of active requests is higher that ~6% of ARC size.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #14516
include/sys/arc_impl.h
module/zfs/dmu_zfetch.c