Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/6.0/release' into 6.0/stage
Browse files Browse the repository at this point in the history
  • Loading branch information
sara hartse committed Jul 7, 2020
2 parents f44d3da + 2476019 commit aba3417
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 5 additions & 3 deletions cmd/arcstat/arcstat
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ cols = {
"grow": [4, 1000, "ARC Grow disabled"],
"need": [4, 1024, "ARC Reclaim need"],
"free": [4, 1024, "ARC Free memory"],
"avail": [4, 1024, "ARC available memory"],
}

v = {}
Expand Down Expand Up @@ -197,15 +198,15 @@ def prettynum(sz, scale, num=0):
elif 0 < num < 1:
num = 0

while num > scale and index < 5:
while abs(num) > scale and index < 5:
save = num
num = num / scale
index += 1

if index == 0:
return "%*d" % (sz, num)

if (save / scale) < 10:
if abs(save / scale) < 10:
return "%*.1f%s" % (sz - 1, num, suffix[index])
else:
return "%*d%s" % (sz - 1, num, suffix[index])
Expand Down Expand Up @@ -429,7 +430,8 @@ def calculate():

v["grow"] = 0 if cur["arc_no_grow"] else 1
v["need"] = cur["arc_need_free"]
v["free"] = cur["arc_sys_free"]
v["free"] = cur["memory_free_bytes"]
v["avail"] = cur["memory_available_bytes"]


def main():
Expand Down
8 changes: 2 additions & 6 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7857,12 +7857,8 @@ arc_init(void)

/* Set min cache to 1/32 of all memory, or 32MB, whichever is more */
arc_c_min = MAX(allmem / 32, 2ULL << SPA_MAXBLOCKSHIFT);
/* set max to 3/4 of all memory, or all but 1GB, whichever is more */
if (allmem >= 1 << 30)
arc_c_max = allmem - (1 << 30);
else
arc_c_max = arc_c_min;
arc_c_max = MAX(allmem * 3 / 4, arc_c_max);
/* set max to 1/2 of all memory */
arc_c_max = MAX(allmem / 2, arc_c_min);

/*
* In userland, there's only the memory pressure that we artificially
Expand Down

0 comments on commit aba3417

Please sign in to comment.