Skip to content

Commit

Permalink
Reclaim metadata when arc_available_memory < 0 even if meta_used is n…
Browse files Browse the repository at this point in the history
…ot 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.

Signed-off-by: Gionatan Danti <[email protected]>
  • Loading branch information
shodanshok committed Oct 30, 2022
1 parent 41fc313 commit 2a1503b
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 2a1503b

Please sign in to comment.