Skip to content

Commit

Permalink
Fix ARC target collapse when zfs_arc_meta_limit_percent=100
Browse files Browse the repository at this point in the history
Reclaim metadata when arc_available_memory < 0 even if
meta_used is not bigger than arc_meta_limit.

As described in openzfs#14054 if
zfs_arc_meta_limit_percent=100 then ARC target can collapse to
arc_min due to arc_purge not freeing any metadata.

This patch lets arc_prune to do its work when arc_available_memory
is negative even if meta_used is not bigger than arc_meta_limit,
avoiding ARC target collapse.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Gionatan Danti <[email protected]>
Closes openzfs#14054 
Closes openzfs#14093
  • Loading branch information
shodanshok committed Nov 3, 2022
1 parent bf507d0 commit 0b16267
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4469,7 +4469,7 @@ arc_evict_meta_balanced(uint64_t meta_used)
* meta buffers. Requests to the upper layers will be made with
* increasingly large scan sizes until the ARC is below the limit.
*/
if (meta_used > arc_meta_limit) {
if (meta_used > arc_meta_limit || arc_available_memory() < 0) {
if (type == ARC_BUFC_DATA) {
type = ARC_BUFC_METADATA;
} else {
Expand Down

0 comments on commit 0b16267

Please sign in to comment.