Date: Tue, 23 Jun 2009 20:45:22 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sys/dev/md md.c src/sys/fs/procfs procfs_map.c src/sys/fs/tmpfs tmpfs_subr.c src/sys/kern kern_fork.c kern_resource.c sys_process.c sysv_shm.c uipc_shm.c src/sys/security/mac_biba mac_biba.c src/sys/security/mac_lomac ... Message-ID: <200906232050.n5NKoS6V069001@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
kib 2009-06-23 20:45:22 UTC
FreeBSD src repository
Modified files:
sys/dev/md md.c
sys/fs/procfs procfs_map.c
sys/fs/tmpfs tmpfs_subr.c
sys/kern kern_fork.c kern_resource.c sys_process.c
sysv_shm.c uipc_shm.c
sys/security/mac_biba mac_biba.c
sys/security/mac_lomac mac_lomac.c
sys/sys priv.h resource.h resourcevar.h
sys/vm default_pager.c device_pager.c
phys_pager.c swap_pager.c vm.h
Log:
SVN rev 194766 on 2009-06-23 20:45:22Z by kib
Implement global and per-uid accounting of the anonymous memory. Add
rlimit RLIMIT_SWAP that limits the amount of swap that may be reserved
for the uid.
The accounting information (charge) is associated with either map entry,
or vm object backing the entry, assuming the object is the first one
in the shadow chain and entry does not require COW. Charge is moved
from entry to object on allocation of the object, e.g. during the mmap,
assuming the object is allocated, or on the first page fault on the
entry. It moves back to the entry on forks due to COW setup.
The per-entry granularity of accounting makes the charge process fair
for processes that change uid during lifetime, and decrements charge
for proper uid when region is unmapped.
The interface of vm_pager_allocate(9) is extended by adding struct ucred *,
that is used to charge appropriate uid when allocation if performed by
kernel, e.g. md(4).
Several syscalls, among them is fork(2), may now return ENOMEM when
global or per-uid limits are enforced.
In collaboration with: pho
Reviewed by: alc
Approved by: re (kensmith)
Revision Changes Path
1.182 +4 -4 src/sys/dev/md/md.c
1.50 +8 -3 src/sys/fs/procfs/procfs_map.c
1.23 +2 -1 src/sys/fs/tmpfs/tmpfs_subr.c
1.304 +16 -2 src/sys/kern/kern_fork.c
1.194 +6 -0 src/sys/kern/kern_resource.c
1.153 +5 -1 src/sys/kern/sys_process.c
1.119 +4 -7 src/sys/kern/sysv_shm.c
1.10 +23 -8 src/sys/kern/uipc_shm.c
1.134 +2 -0 src/sys/security/mac_biba/mac_biba.c
1.78 +2 -0 src/sys/security/mac_lomac/mac_lomac.c
1.35 +8 -0 src/sys/sys/priv.h
1.35 +3 -1 src/sys/sys/resource.h
1.55 +6 -0 src/sys/sys/resourcevar.h
1.36 +21 -4 src/sys/vm/default_pager.c
1.89 +3 -2 src/sys/vm/device_pager.c
1.31 +1 -1 src/sys/vm/phys_pager.c
1.311 +152 -7 src/sys/vm/swap_pager.c
1.29 +7 -0 src/sys/vm/vm.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906232050.n5NKoS6V069001>
