🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: maxlwp

#47
From: Christos Zoulas
Date: Fri, 29 Mar 2013 14:29
69 lines
3913 bytes
On Mar 29,  2:18pm, yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) wrote:
-- Subject: maxlwp

| 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?

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

I am not sure what a reasonable value for this is. It was the number that
came out of my hat at the time.

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

LGTM.

christos
| 
| YAMAMOTO Takashi
| 
| --Boundary-20130329230857-1693902
| Content-Type: Text/Plain; charset=us-ascii
| Content-Disposition: attachment; filename="a.diff"
| 
| 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--
-- End of excerpt from YAMAMOTO Takashi
Technical Details
Message-ID: <fa.firFiVQLD5SrLT51sq8+lRxtikg@ifi.uio.no>
Path: arc1-ca.pugleaf.net!ex12ni10543wid.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!195.208.113.1.MISMATCH!goblin3!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mail
References: <fa.M9pRIYMFMWt2fCL/LNo6psZD/4Y@ifi.uio.no>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10c6f4,d17dafe1227104aa
X-Google-NewGroupId: yes
X-Google-Attributes: gidb7e13b6095,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
X-Received: by 10.180.98.103 with SMTP id eh7mr886748wib.3.1364567399314;
        Fri, 29 Mar 2013 07:29:59 -0700 (PDT)
MIME-Version: 1.0
Path: arc1-ca.pugleaf.net!ex12ni10543wid.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!195.208.113.1.MISMATCH!goblin3!goblin1!goblin.stu.neva.ru!uio.no!nntp.uio.no!.POSTED!not-for-mail
From: christos@zoulas.com (Christos Zoulas)
Newsgroups: fa.netbsd.tech.kern
Subject: Re: maxlwp
Date: Fri, 29 Mar 2013 14:29:59 UTC
Organization: Astron Software
Lines: 71
Sender: tech-kern-owner@NetBSD.org
Message-ID: <fa.firFiVQLD5SrLT51sq8+lRxtikg@ifi.uio.no>
References: <fa.M9pRIYMFMWt2fCL/LNo6psZD/4Y@ifi.uio.no>
NNTP-Posting-Host: mail-jess.uio.no
X-Trace: readme.uio.no 1364567399 6446 129.240.7.9 (29 Mar 2013 14:29:59 GMT)
X-Complaints-To: abuse@uio.no
NNTP-Posting-Date: Fri, 29 Mar 2013 14:29:59 +0000 (UTC)
Cc: tech-kern@netbsd.org
To: yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi)
Delivered-To: tech-kern@netbsd.org
X-Virus-Scanned: amavisd-new at NetBSD.org
In-Reply-To: <20130329141822.E31BA14A1E9@mail.netbsd.org>
       from YAMAMOTO Takashi (Mar 29,  2:18pm)
X-Mailer: Mail User's Shell (7.2.6 beta(4.pl1)+dynamic 20000103)
List-Id: tech-kern.NetBSD.org
Original-Date: Fri, 29 Mar 2013 10:29:46 -0400
Original-Message-Id: <20130329142946.5F8A797129@rebar.astron.com>