freebsd-skq/sys/fs
Konstantin Belousov 3364c323e6 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)
2009-06-23 20:45:22 +00:00
..
cd9660 Update the inline version of vn_get_ino() for ".." lookups to match the 2009-06-12 21:19:57 +00:00
coda Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
deadfs Add a simple VOP_VPTOCNP implementation for deadfs which returns EBADF. 2008-12-12 00:59:36 +00:00
devfs Improve nested jail awareness of devfs by handling credentials. 2009-06-20 14:50:32 +00:00
fdescfs Report all fdescfs vnodes as VCHR for stat(2). Fake the unique 2009-05-12 09:28:45 +00:00
fifofs s/a_fdidx/a_fp/ for VOP_OPEN comments that inline struct vop_open_args 2009-06-10 14:09:05 +00:00
hpfs Remove the thread argument from the FSD (File-System Dependent) parts of 2009-05-11 15:33:26 +00:00
msdosfs Fix r193923 by noting that type of a_fp is struct file *, not int. 2009-06-10 14:24:31 +00:00
nfs Replace RPCAUTH_UNIXGIDS with NFS_MAXGRPS so that nfscbd.c will build. 2009-06-20 17:11:07 +00:00
nfsclient Replace RPCAUTH_UNIXGIDS with NFS_MAXGRPS so that nfscbd.c will build. 2009-06-20 17:11:07 +00:00
nfsserver Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
ntfs In non-debugging mode make this define (void)0 instead of nothing. This 2009-06-21 08:36:30 +00:00
nullfs Add explicit struct ucred * argument for VOP_VPTOCNP, to be used by 2009-06-21 19:21:01 +00:00
nwfs Eliminate the unnecessary clearing of a page's dirty bits from 2009-05-23 18:25:11 +00:00
portalfs Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00
procfs Implement global and per-uid accounting of the anonymous memory. Add 2009-06-23 20:45:22 +00:00
pseudofs VOP_IOCTL takes unlocked vnode as an argument. Due to this, v_data may 2009-06-10 13:57:36 +00:00
smbfs Make *getpages()s' assertion on the state of each page's dirty bits 2009-05-28 18:11:09 +00:00
tmpfs Implement global and per-uid accounting of the anonymous memory. Add 2009-06-23 20:45:22 +00:00
udf Use #ifdef APPLE_MAC instead of #ifdef MAC to conditionalize Apple-specific 2009-06-06 07:13:57 +00:00
unionfs Rework the credential code to support larger values of NGROUPS and 2009-06-19 17:10:35 +00:00