NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

xsrc/49912: src/sys/sys/resource.h usage clean-up



>Number:         49912
>Category:       xsrc
>Synopsis:       src/sys/sys/resource.h usage clean-up
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 19 02:10:00 +0000 2015
>Originator:     Kamil Rytarowski
>Release:        -current
>Organization:
>Environment:
N/A
>Description:
I'm attaching a patch to clean-up resources usage:
- add vmemoryuse to login_cap(3)
- document vmemoryuse in login.conf(5)
- document proc.pid.rlimit.vmemoryuse and proc.pid.rlimit.maxlwp in sysctl(7)
- document SBSIZE, AS, VMEM and NTHR in share/doc/psd/05.sysman/1.6.t

The login_cap(3) part was suggested and the patch tested by Dominik Biały (known as DMB).
>How-To-Repeat:
N/A
>Fix:
? share/man/man9/devsw_attach.9
Index: share/man/man5/login.conf.5
===================================================================
RCS file: /cvsroot/src/share/man/man5/login.conf.5,v
retrieving revision 1.28
diff -u -r1.28 login.conf.5
--- share/man/man5/login.conf.5	29 Jun 2013 08:14:31 -0000	1.28
+++ share/man/man5/login.conf.5	19 May 2015 01:57:48 -0000
@@ -271,6 +271,10 @@
 .Xr umask 2 .
 .\"
 .sp
+.It Sy vmemoryuse Ta size Ta "" Ta
+The maximum size (in bytes) which a process can obtain.
+.\"
+.sp
 .It Sy welcome Ta file Ta Li /etc/motd Ta
 File containing welcome message.
 .Xr login 1
Index: share/man/man7/sysctl.7
===================================================================
RCS file: /cvsroot/src/share/man/man7/sysctl.7,v
retrieving revision 1.84
diff -u -r1.84 sysctl.7
--- share/man/man7/sysctl.7	17 Jul 2014 13:42:02 -0000	1.84
+++ share/man/man7/sysctl.7	19 May 2015 01:57:48 -0000
@@ -2044,6 +2044,12 @@
 and
 .Dv SO_SNDBUF
 options.
+.It Li proc.pid.rlimit.vmemoryuse ( PROC_PID_LIMIT_AS and a common alias
+PROC_PID_LIMIT_VMEM )
+The maximum size (in bytes) which a process can obtain.
+.It Li proc.pid.rlimit.maxlwp ( PROC_PID_LIMIT_NTHR )
+The maximim number of threads.
+The first thread of each process is not counted against this.
 .El
 .Pp
 The fifth level name is one of
Index: lib/libutil/login_cap.c
===================================================================
RCS file: /cvsroot/src/lib/libutil/login_cap.c,v
retrieving revision 1.31
diff -u -r1.31 login_cap.c
--- lib/libutil/login_cap.c	29 Jun 2013 04:52:55 -0000	1.31
+++ lib/libutil/login_cap.c	19 May 2015 01:57:48 -0000
@@ -424,6 +424,7 @@
 	{ RLIMIT_NOFILE,	R_CNUMB, "openfiles", },
 	{ RLIMIT_CORE,		R_CSIZE, "coredumpsize", },
 	{ RLIMIT_SBSIZE,	R_CSIZE, "sbsize", },
+	{ RLIMIT_AS,		R_CSIZE, "vmemoryuse", },
 	{ -1, 0, 0 }
 };
 
Index: share/doc/psd/05.sysman/1.6.t
===================================================================
RCS file: /cvsroot/src/share/doc/psd/05.sysman/1.6.t,v
retrieving revision 1.5
diff -u -r1.5 1.6.t
--- share/doc/psd/05.sysman/1.6.t	6 Oct 2013 05:45:19 -0000	1.5
+++ share/doc/psd/05.sysman/1.6.t	19 May 2015 01:57:48 -0000
@@ -133,6 +133,10 @@
 RLIMIT_MEMLOCK	/* locked-in-memory address space */
 RLIMIT_NPROC	/* number of processes */
 RLIMIT_NOFILE	/* number of open files */
+RLIMIT_SBSIZE	/* maximum size of all socket buffers */
+RLIMIT_AS	/* virtual process size (inclusive of mmap) */
+RLIMIT_VMEM	/* common alias of RLIMIT_AS */
+RLIMIT_NTHR	/* number of threads */
 .TE
 .DE
 .ne 1i



Home | Main Index | Thread Index | Old Index