resource limits Giant patch

From: Mike Makonnen <mtm_at_identd.net>
Date: Thu, 3 Apr 2003 06:19:38 -0500
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_at_identd.net | D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9
Received on Thu Apr 03 2003 - 01:19:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:02 UTC