File tree 1 file changed +17
-7
lines changed
1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -637,15 +637,25 @@ def apply_zfs_arcstats(vm_stats: svmem):
637
637
638
638
# When accounting for zfs memory, we need to keep track of "shared"
639
639
# So "used" memory is more relevant than "available"
640
- vm_stats .used += vm_stats .shared
641
- vm_stats .cached -= vm_stats .shared
642
640
shrinkable_size = max (zfs_size - zfs_min , 0 )
643
- vm_stats .used -= shrinkable_size
644
- vm_stats .cached += shrinkable_size
645
- vm_stats .available += shrinkable_size
646
- vm_stats . percent = usage_percent (vm_stats .used , vm_stats .total , round_ = 1 )
641
+ used = vm_stats .used + vm_stats . shared - shrinkable_size
642
+ cached = vm_stats .cached - vm_stats . shared + shrinkable_size
643
+ available = vm_stats .available + shrinkable_size
644
+ percent = usage_percent (vm_stats .used , vm_stats .total , round_ = 1 )
647
645
648
- return vm_stats
646
+ return svmem (
647
+ vm_stats .total ,
648
+ available ,
649
+ percent ,
650
+ used ,
651
+ vm_stats .free ,
652
+ vm_stats .active ,
653
+ vm_stats .inactive ,
654
+ vm_stats .buffers ,
655
+ cached ,
656
+ vm_stats .shared ,
657
+ vm_stats .slab ,
658
+ )
649
659
650
660
651
661
# =====================================================================
You can’t perform that action at this time.
0 commit comments