🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fa.netbsd.tech.kern
Article #45

maxlwp

#45
From: YAMAMOTO Takashi
Date: Fri, 29 Mar 2013 14:18
61 lines
3443 bytes
--Boundary-20130329230857-1693902
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 8bit

hi,

i have some questions about maxlwp stuff.

- unlike kern.maxproc which restricts the total number of processes in
a system, kern.maxlwp's sole purpose is to restrict setrlimit.  is it right?
if so, why the usual kauth check to prevent raising a hard limit is not
enough?

- default cpu_maxlwp() returns 2048.  what's the rationale of this
small value?  IMO a better default is "unlimited".

- i want login.conf support for this.  is the attached patch ok?

YAMAMOTO Takashi

--Boundary-20130329230857-1693902
Content-Type: Text/Plain; charset=us-ascii
Content-Disposition: attachment; filename="a.diff"
Content-Transfer-Encoding: 8bit

Index: lib/libutil/login_cap.c
===================================================================
RCS file: /cvsroot/src/lib/libutil/login_cap.c,v
retrieving revision 1.30
diff -u -p -r1.30 login_cap.c
--- lib/libutil/login_cap.c	7 Apr 2012 16:16:34 -0000	1.30
+++ lib/libutil/login_cap.c	29 Mar 2013 14:09:51 -0000
@@ -420,6 +420,7 @@ static struct {
 	{ RLIMIT_RSS,		R_CSIZE, "memoryuse", },
 	{ RLIMIT_MEMLOCK,	R_CSIZE, "memorylocked", },
 	{ RLIMIT_NPROC,		R_CNUMB, "maxproc", },
+	{ RLIMIT_NTHR,		R_CNUMB, "maxthread", },
 	{ RLIMIT_NOFILE,	R_CNUMB, "openfiles", },
 	{ RLIMIT_CORE,		R_CSIZE, "coredumpsize", },
 	{ RLIMIT_SBSIZE,	R_CSIZE, "sbsize", },
Index: share/man/man5/login.conf.5
===================================================================
RCS file: /cvsroot/src/share/man/man5/login.conf.5,v
retrieving revision 1.26
diff -u -p -r1.26 login.conf.5
--- share/man/man5/login.conf.5	30 Apr 2012 11:07:28 -0000	1.26
+++ share/man/man5/login.conf.5	29 Mar 2013 14:09:52 -0000
@@ -167,6 +167,11 @@ Number of login attempts after which to 
 Maximum number of processes.
 .\"
 .sp
+.It Sy maxthread Ta number Ta "" Ta
+Maximum number of threads.
+First thread of each process are not counted against this.
+.\"
+.sp
 .It Sy memorylocked Ta size Ta "" Ta
 Maximum locked in core memory size limit.
 .\"

--Boundary-20130329230857-1693902--
Technical Details
Message-ID: <fa.M9pRIYMFMWt2fCL/LNo6psZD/4Y@ifi.uio.no>
Path: arc1-ca.pugleaf.net!p18ni24886wiv.0!nntp.google.com!goblin2!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10c6f4,d17dafe1227104aa,start
X-Google-NewGroupId: yes
X-Google-Attributes: gidb7e13b6095,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
X-Received: by 10.180.20.239 with SMTP id q15mr4478437wie.7.1364566719154;
        Fri, 29 Mar 2013 07:18:39 -0700 (PDT)
Path: arc1-ca.pugleaf.net!p18ni24886wiv.0!nntp.google.com!goblin2!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mail
From: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
Newsgroups: fa.netbsd.tech.kern
Subject: maxlwp
Date: Fri, 29 Mar 2013 14:18:38 UTC
Organization: Internet mailing list
Lines: 62
Sender: tech-kern-owner@NetBSD.org
Message-ID: <fa.M9pRIYMFMWt2fCL/LNo6psZD/4Y@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
Mime-Version: 1.0
X-Trace: readme.uio.no 1364566718 5792 129.240.7.9 (29 Mar 2013 14:18:38 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Fri, 29 Mar 2013 14:18:38 +0000 (UTC)
Cc: tech-kern@netbsd.org
To: christos@netbsd.org
Delivered-To: tech-kern@netbsd.org
X-Mailer: Cue version 0.8 (111031-0948/takashi)
List-Id: tech-kern.NetBSD.org
Original-Date: Fri, 29 Mar 2013 14:18:22 +0000 (UTC)
Original-Message-Id: <20130329141822.E31BA14A1E9@mail.netbsd.org>
Content-Type: Multipart/Mixed; boundary="Boundary-20130329230857-1693902"