diff options
author | jeff <jeff@FreeBSD.org> | 2008-03-19 06:19:01 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2008-03-19 06:19:01 +0000 |
commit | 46f09d5bc3f6480ce5db48b9d76f3e83299f588c (patch) | |
tree | 720fece23c8482c35e341e275a0f4068ee43126f /sys/kern/sys_generic.c | |
parent | f8600f40e7fcf241985d8a978c63889de0969bfb (diff) | |
download | FreeBSD-src-46f09d5bc3f6480ce5db48b9d76f3e83299f588c.zip FreeBSD-src-46f09d5bc3f6480ce5db48b9d76f3e83299f588c.tar.gz |
- Relax requirements for p_numthreads, p_threads, p_swtick, and p_nice from
requiring the per-process spinlock to only requiring the process lock.
- Reflect these changes in the proc.h documentation and consumers throughout
the kernel. This is a substantial reduction in locking cost for these
fields and was made possible by recent changes to threading support.
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 90946ea..209e5a9 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -1013,13 +1013,8 @@ poll(td, uap) * least enough for the current limits. We want to be reasonably * safe, but not overly restrictive. */ - PROC_LOCK(td->td_proc); - if ((nfds > lim_cur(td->td_proc, RLIMIT_NOFILE)) && - (nfds > FD_SETSIZE)) { - PROC_UNLOCK(td->td_proc); + if (nfds > maxfilesperproc && nfds > FD_SETSIZE) return (EINVAL); - } - PROC_UNLOCK(td->td_proc); ni = nfds * sizeof(struct pollfd); if (ni > sizeof(smallbits)) bits = malloc(ni, M_TEMP, M_WAITOK); |