git: kernel - Add per-user file descriptor limit

看板DFBSD_commit作者時間15年前 (2010/08/11 08:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/3 (看更多)
commit d37c8f7fecbdf4f76bd481048935533b58b88baa Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Tue Aug 10 16:27:27 2010 -0700 kernel - Add per-user file descriptor limit * Add kern.maxfilesperuser and kern.minfilesperproc to complement the kern.maxfilesperproc which already exists. Print a warning on the console if a user hits the limit (rate limited). * Track per-user files via the uidinfo structure. Each file pointer counts as one file. dup()'d and fork()'d file descriptors do not count. * Adjust the default user limits to approximately 1/4 the system maximums instead of 9/10 the system maximums. This reduces the maximum descriptors per process and the maximum processes per uid. They can be raised again via sysctl. * Set minfilesperproc to 8 by default. This is a safety which guarantees that a process can always have at least that many open descriptors without tripping over kern.maxfilesperuser. Reported-by: swildner Summary of changes: sys/kern/kern_descrip.c | 116 +++++++++++++++++++++++++++++++++++++++------ sys/kern/kern_resource.c | 8 ++-- sys/kern/subr_param.c | 35 +++++++++++++- sys/sys/file.h | 2 + sys/sys/resourcevar.h | 2 + 5 files changed, 140 insertions(+), 23 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d37c8f7fecbdf4f76bd481048935533b58b88baa -- DragonFly BSD source repository
文章代碼(AID): #1COUX5y0 (DFBSD_commit)
文章代碼(AID): #1COUX5y0 (DFBSD_commit)