NetBSD Problem Report #49912
From www@NetBSD.org Tue May 19 02:09:05 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id A049EA6551
for <gnats-bugs@gnats.NetBSD.org>; Tue, 19 May 2015 02:09:05 +0000 (UTC)
Message-Id: <20150519020904.37904A65D6@mollari.NetBSD.org>
Date: Tue, 19 May 2015 02:09:04 +0000 (UTC)
From: n54@gmx.com
Reply-To: n54@gmx.com
To: gnats-bugs@NetBSD.org
Subject: src/sys/sys/resource.h usage clean-up
X-Send-Pr-Version: www-1.0
>Number: 49912
>Category: xsrc
>Synopsis: src/sys/sys/resource.h usage clean-up
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: xsrc-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue May 19 02:10:00 +0000 2015
>Closed-Date: Thu Aug 17 18:50:46 +0000 2017
>Last-Modified: Thu Aug 17 18:50:46 +0000 2017
>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
>Release-Note:
>Audit-Trail:
From: Taylor R Campbell <riastradh@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: xsrc/49912
Date: Fri, 10 Jul 2015 02:56:46 +0000
Date: Tue, 19 May 2015 02:09:04 +0000 (UTC)
From: Kamil Rytarowski <n54@gmx.com>
--- 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
...
+.It Sy vmemoryuse Ta size Ta "" Ta
+The maximum size (in bytes) which a process can obtain.
For consistency with other entries, this should be: `Maximum virtual
address space limit.'
Separately, this and the other entries -- e.g., datasize -- should be
changed to just say `Maximum foo.' without the redundant word `limit',
and should specify that it's in bytes: `Maximum sbrk(2) data size in
bytes.', `Maximum virtual address space size in bytes.', &c.
--- 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
+.It Li proc.pid.rlimit.vmemoryuse ( PROC_PID_LIMIT_AS and a common alias
This, and all the other entries, should use `Dv PROC_PID_LIMIT_AS'.
+PROC_PID_LIMIT_VMEM )
PROC_PID_LIMIT_VMEM does not appear to exist, nor is it necessary.
+.It Li proc.pid.rlimit.maxlwp ( PROC_PID_LIMIT_NTHR )
+The maximim number of threads.
^ `maximum'
Add `...that can be created and running at one time in the process.'
--- 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
+RLIMIT_VMEM /* common alias of RLIMIT_AS */
Say `alias for RLIMIT_AS'.
From: "Kamil Rytarowski" <kamil@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49912 CVS commit: src
Date: Sat, 11 Jul 2015 09:21:23 +0000
Module Name: src
Committed By: kamil
Date: Sat Jul 11 09:21:23 UTC 2015
Modified Files:
src/lib/libutil: login_cap.c
src/share/doc/psd/05.sysman: 1.6.t
src/share/man/man5: login.conf.5
src/share/man/man7: sysctl.7
Log Message:
Clean-up resources (sys/sys/resource.h) 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
Reviewed by <riastradh>
Approved by <pgoyette>
Tested by Dominik Bialy
Closes PR xsrc/49912
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libutil/login_cap.c
cvs rdiff -u -r1.5 -r1.6 src/share/doc/psd/05.sysman/1.6.t
cvs rdiff -u -r1.28 -r1.29 src/share/man/man5/login.conf.5
cvs rdiff -u -r1.87 -r1.88 src/share/man/man7/sysctl.7
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Sat, 11 Jul 2015 11:42:03 +0200
State-Changed-Why:
Patch has been committed.
From: "Kamil Rytarowski" <kamil@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49912 CVS commit: src/share/man/man5
Date: Sat, 11 Jul 2015 14:18:08 +0000
Module Name: src
Committed By: kamil
Date: Sat Jul 11 14:18:08 UTC 2015
Modified Files:
src/share/man/man5: login.conf.5
Log Message:
Clean-up documentation of login.conf(5)
Remove redundant word "limit" from sentences "Maximum ...".
Note that vmemoryuse might specify both maximum and current limits.
Remove redundant 'in bytes' from the description of vmemoryuse, it's noted
in the next section describing the argument type 'size'.
Changes inspired by <riastradh> in PR xsrc/49912
To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/share/man/man5/login.conf.5
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Kamil Rytarowski" <kamil@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49912 CVS commit: src/share/man/man7
Date: Sat, 11 Jul 2015 17:24:13 +0000
Module Name: src
Committed By: kamil
Date: Sat Jul 11 17:24:13 UTC 2015
Modified Files:
src/share/man/man7: sysctl.7
Log Message:
Use more macros for symbolic constants
This change was suggested by <riastradh> in PR xsrc/49912
The change idea was approved by <wiz>
To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/share/man/man7/sysctl.7
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: closed->pending-pullups
State-Changed-By: kamil@NetBSD.org
State-Changed-When: Fri, 31 Jul 2015 18:41:57 +0200
State-Changed-Why:
pullup-6 and pullup-7 requested by a user
From: Kamil Rytarowski <n54@gmx.com>
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, kamil@NetBSD.org
Cc:
Subject: Re: xsrc/49912 (src/sys/sys/resource.h usage clean-up)
Date: Fri, 31 Jul 2015 19:02:20 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
pullup numbers:
- - pullup-6 #1317
- - pullup-7 #927
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJVu6oaAAoJEEuzCOmwLnZsA/YQAIBnTU7cn7SQ1cwSKS77aUYt
hZoX+xePFjay/XtalplcUNKbsL6bXGgIqjfLfF1/Mg/gyKVOP7iQVsrdYTmofE4L
sUFvZsQJTqjOIUpUpFYGjMWQJCTg3pTIk1byojfkFHYw9bn9kNnknTSvY1/1h/1D
5aYv4jB3ysG440l+0ar/SmlNX9NnB2zO1+kkCdKUQXfTRAcf3CzqW3jYwrB8zHL9
JR1PFQLi0/so6jEc9GT7WamrJTqsPIKuLEBOCfT2IfpPTmaLmGJTCJr5mFRxWkfo
ChJK3m26FsDfJFlIvZmV+JIh+biVzyhFVPesNgkaSZzjHi1P+wVZe/7+pf1O7xxM
6V+mDVAOvc6W4APbaXx+jwVI5/6GfP4KRh3r0Mqlx+XaOn5vEuUA8XpRWAaP62SQ
YfUckIwm9QFKY0IfLcQr4LaMphKVJtIF7w2ZsFGW0VePqjVxorEypfmHaP7jBxZR
PxORyoRRFSLDtlY3UxIkxS3wxNh5lvV2d0KC5+iq3wjieUEJxGnkP8FEpYJWW6CP
cz2ggRoIgI5VezKwn/gJmp4mUG1py9IlL71f1AOeliDBT/f7ppYD1639s3L0+0V6
6td18JHMVXrQmdHLIJHIYSSu1FgoCyXKwCc9831BjdGSTdJzeuib1XlTA0Tq3gjr
gov9JMfmHqlX1Gu/Z8aY
=h6Ja
-----END PGP SIGNATURE-----
From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49912 CVS commit: [netbsd-7] src
Date: Wed, 4 Nov 2015 16:40:58 +0000
Module Name: src
Committed By: riz
Date: Wed Nov 4 16:40:58 UTC 2015
Modified Files:
src/lib/libutil [netbsd-7]: login_cap.c
src/share/man/man5 [netbsd-7]: login.conf.5
Log Message:
Pull up following revision(s) (requested by kamil in ticket #927):
share/man/man5/login.conf.5: revision 1.29
share/man/man7/sysctl.7: revision 1.88
share/man/man5/login.conf.5: revision 1.30
lib/libutil/login_cap.c: revision 1.32
share/man/man5/login.conf.5: revision 1.31
share/doc/psd/05.sysman/1.6.t: revision 1.6
Clean-up resources (sys/sys/resource.h) usage
Add vmemoryuse to login_cap(3)
Document vmemoryuse in login.conf(5)
Reviewed by <riastradh>
Approved by <pgoyette>
Tested by Dominik Bialy
Closes PR xsrc/49912
Bump date for previous.
Clean-up documentation of login.conf(5)
Remove redundant word "limit" from sentences "Maximum ...".
Note that vmemoryuse might specify both maximum and current limits.
Remove redundant 'in bytes' from the description of vmemoryuse, it's not
ed
in the next section describing the argument type 'size'.
Changes inspired by <riastradh> in PR xsrc/49912
To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.6.1 src/lib/libutil/login_cap.c
cvs rdiff -u -r1.28 -r1.28.6.1 src/share/man/man5/login.conf.5
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/49912 CVS commit: [netbsd-6] src
Date: Sun, 15 Nov 2015 16:58:20 +0000
Module Name: src
Committed By: bouyer
Date: Sun Nov 15 16:58:20 UTC 2015
Modified Files:
src/lib/libutil [netbsd-6]: login_cap.c
src/share/man/man5 [netbsd-6]: login.conf.5
Log Message:
Pull up following revision(s) (requested by kamil in ticket #1317):
share/man/man5/login.conf.5: revisions 1.29, 1.30, 1.31
lib/libutil/login_cap.c: revision 1.32
Clean-up resources (sys/sys/resource.h) 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
Reviewed by <riastradh>
Approved by <pgoyette>
Tested by Dominik Bialy
Closes PR xsrc/49912
Bump date for previous.
Clean-up documentation of login.conf(5)
Remove redundant word "limit" from sentences "Maximum ...".
Note that vmemoryuse might specify both maximum and current limits.
Remove redundant 'in bytes' from the description of vmemoryuse, it's not
ed
in the next section describing the argument type 'size'.
Changes inspired by <riastradh> in PR xsrc/49912
To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.29.32.1 src/lib/libutil/login_cap.c
cvs rdiff -u -r1.25 -r1.25.4.1 src/share/man/man5/login.conf.5
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: pending-pullups->closed
State-Changed-By: jdolecek@NetBSD.org
State-Changed-When: Thu, 17 Aug 2017 18:50:46 +0000
State-Changed-Why:
Pullups done to netbsd-6 and netbsd-7. Thank you.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.