diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2014-03-22 10:26:09 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2014-03-22 10:26:09 +0000 |
commit | 6fcf6199a4a9aefe9f2e59d947f0e0df171367b5 (patch) | |
tree | 9a9561ab626d2c7b17fbd98a498de2fac743ab08 /sys/kern | |
parent | e97a0e252b398acead00694bf1d357d9089128ad (diff) | |
download | FreeBSD-src-6fcf6199a4a9aefe9f2e59d947f0e0df171367b5.zip FreeBSD-src-6fcf6199a4a9aefe9f2e59d947f0e0df171367b5.tar.gz |
Rename global cnt to vm_cnt to avoid shadowing.
To reduce the diff struct pcu.cnt field was not renamed, so
PCPU_OP(cnt.field) is still used. pc_cnt and pcpu are also used in
kvm(3) and vmstat(8). The goal was to not affect externally used KPI.
Bump __FreeBSD_version_ in case some out-of-tree module/code relies on the
the global cnt variable.
Exp-run revealed no ports using it directly.
No objection from: arch@
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/init_main.c | 2 | ||||
-rw-r--r-- | sys/kern/kern_malloc.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_mib.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_bio.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 6 |
5 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ed343b6..141d438 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -544,7 +544,7 @@ proc0_init(void *dummy __unused) p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_cur = dflssiz; p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_max = maxssiz; /* Cast to avoid overflow on i386/PAE. */ - pageablemem = ptoa((vm_paddr_t)cnt.v_free_count); + pageablemem = ptoa((vm_paddr_t)vm_cnt.v_free_count); p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_cur = p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = pageablemem; p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = pageablemem / 3; diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 901ad8a..658908c 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -711,7 +711,7 @@ kmeminit(void) * VM_KMEM_SIZE_MAX is itself a function of the available KVA space on * a given architecture. */ - mem_size = cnt.v_page_count; + mem_size = vm_cnt.v_page_count; vm_kmem_size_scale = VM_KMEM_SIZE_SCALE; TUNABLE_INT_FETCH("vm.kmem_size_scale", &vm_kmem_size_scale); @@ -819,7 +819,7 @@ malloc_init(void *data) struct malloc_type_internal *mtip; struct malloc_type *mtp; - KASSERT(cnt.v_page_count != 0, ("malloc_register before vm_init")); + KASSERT(vm_cnt.v_page_count != 0, ("malloc_register before vm_init")); mtp = data; if (mtp->ks_magic != M_MAGIC) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index ac6196c..213482b 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -199,7 +199,7 @@ sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { u_long val; - val = ctob(physmem - cnt.v_wire_count); + val = ctob(physmem - vm_cnt.v_wire_count); return (sysctl_handle_long(oidp, &val, 0, req)); } diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 8e4fdf8..83cfc09 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -4290,7 +4290,7 @@ vm_hold_free_pages(struct buf *bp, int newbsize) (intmax_t)bp->b_blkno, (intmax_t)bp->b_lblkno); p->wire_count--; vm_page_free(p); - atomic_subtract_int(&cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); } bp->b_npages = newnpages; } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 91c64a3..dd2d53d 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -330,8 +330,8 @@ vntblinit(void *dummy __unused) * size. The memory required by desiredvnodes vnodes and vm objects * may not exceed one seventh of the kernel's heap size. */ - physvnodes = maxproc + cnt.v_page_count / 16 + 3 * min(98304 * 4, - cnt.v_page_count) / 16; + physvnodes = maxproc + vm_cnt.v_page_count / 16 + 3 * min(98304 * 4, + vm_cnt.v_page_count) / 16; virtvnodes = vm_kmem_size / (7 * (sizeof(struct vm_object) + sizeof(struct vnode))); desiredvnodes = min(physvnodes, virtvnodes); @@ -708,7 +708,7 @@ vlrureclaim(struct mount *mp) usevnodes = desiredvnodes; if (usevnodes <= 0) usevnodes = 1; - trigger = cnt.v_page_count * 2 / usevnodes; + trigger = vm_cnt.v_page_count * 2 / usevnodes; done = 0; vn_start_write(NULL, &mp, V_WAIT); MNT_ILOCK(mp); |