[Bug 244319] vm.v_* sysctls should be read-only, make per-domain sysctls writable

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Feb 22 18:24:13 UTC 2020


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244319

            Bug ID: 244319
           Summary: vm.v_* sysctls should be read-only, make per-domain
                    sysctls writable
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: alex_y_xu at yahoo.ca
                CC: jeff at FreeBSD.org

after
https://svnweb.freebsd.org/base/head/sys/vm/vm_pageout.c?r1=327954&r2=328954
(https://reviews.freebsd.org/D14000), the various v_* targets were made
domain-specific, and vm_cnt was made a sum of the individual domain metrics.
however, it doesn't seem to consider that those sysctls are actually
read-write, not read-only in vm_meter. the easy fix is to just make the
top-level sysctls read-only, but I think that it would be better to make the
per-domain sysctls also writable. the top-level sysctls can't be removed
because vm/swap_pager.c checks vm_cnt.v_free_reserved, and
cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c checks vm_cnt.v_free_target. I
suspect that the swap accounting should actually be domain-aware though.
anyways, you still need to update vm_cnt.v_free_reserved and
vm_cnt.v_free_target, and at that point you might as well keep everything.

I think VM_STATS_UINT(v_*) except v_*_count should probably be removed though,
since they are not really "statistics", and sysctls for vmd_interrupt_free_min
and vmd_pageout_free_min should be added.

I tried making a patch, but I couldn't figure out how to work SYSCTL_ADD_PROC.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list