Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Apr 2003 06:19:38 -0500
From:      Mike Makonnen <mtm@identd.net>
To:        freebsd-current@freebsd.org
Subject:   resource limits Giant patch
Message-ID:  <20030403111939.QDSE1728.pop015.verizon.net@kokeb.ambesa.net>

next in thread | raw e-mail | index | archive | help

The following patches at http://people.freebsd.org/~mtm
remove process resource limits out from under Giant. I have been bouncing
them off jhb for a while now, and I think they are ready. I would appreciate
a review/testing....

There are 4 incremental patches for your reviewing pleasure :-)
infrastructure.diff	- The necessary infrastructure to do the locking
users.diff		   - Modify consumers of resource limits to use the locks
giant.diff		    - actually remove Giant from (most of) those areas
regen.diff		   - Regenerated files, if you don't care to regenerate your own

The basic implementation:
Each plimit now has an associated mutex.
To read an individual limit it is sufficient that the proc lock is held.
To modify a limit or in situations where you need a consitent view of
a particular limit(s) both the proc lock and the plimit locks are held.
Three new functions can be use to get limits: lim_cur(), lim_max(), and
lim_rlimit(), that can be used to obtain the current limit, the hard limit, and
the entire rlimit structure, respectively.
A limit_lock has been defined to protect the following three globals:
	maxfiles, maxfilesperproc, and maxprocperuid 
They each now have their own sysctl proc that grabs the limit_lock
in order to write them.


Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
mtm@identd.net | D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030403111939.QDSE1728.pop015.verizon.net>