diff options
author | jeff <jeff@FreeBSD.org> | 2007-05-18 07:10:50 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2007-05-18 07:10:50 +0000 |
commit | e1996cb9609d2e55a26ee78dddbfce4ba4073b53 (patch) | |
tree | c94b660d4b9246fed8cbeadf7851932258d8b72a /sys/vm/vm_glue.c | |
parent | beb495eff1db0646624feb7071ced7f632ff8869 (diff) | |
download | FreeBSD-src-e1996cb9609d2e55a26ee78dddbfce4ba4073b53.zip FreeBSD-src-e1996cb9609d2e55a26ee78dddbfce4ba4073b53.tar.gz |
- define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulating
vmcnts. This can be used to abstract away pcpu details but also changes
to use atomics for all counters now. This means sched lock is no longer
responsible for protecting counts in the switch routines.
Contributed by: Attilio Rao <attilio@FreeBSD.org>
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r-- | sys/vm/vm_glue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index a3749bf..4981efc 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -219,7 +219,7 @@ vslock(void *addr, size_t len) * Also, the sysctl code, which is the only present user * of vslock(), does a hard loop on EAGAIN. */ - if (npages + cnt.v_wire_count > vm_page_max_wired) + if (npages + VMCNT_GET(wire_count) > vm_page_max_wired) return (EAGAIN); #endif error = vm_map_wire(&curproc->p_vmspace->vm_map, start, end, @@ -589,7 +589,7 @@ vm_init_limits(udata) limp->pl_rlimit[RLIMIT_DATA].rlim_cur = dfldsiz; limp->pl_rlimit[RLIMIT_DATA].rlim_max = maxdsiz; /* limit the limit to no less than 2MB */ - rss_limit = max(cnt.v_free_count, 512); + rss_limit = max(VMCNT_GET(free_count), 512); limp->pl_rlimit[RLIMIT_RSS].rlim_cur = ptoa(rss_limit); limp->pl_rlimit[RLIMIT_RSS].rlim_max = RLIM_INFINITY; } |