From owner-freebsd-smp Mon Jul 8 10:39:59 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CCAF37B400 for ; Mon, 8 Jul 2002 10:39:57 -0700 (PDT) Received: from rhenium.btinternet.com (rhenium.btinternet.com [194.73.73.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 06F7A43E3B for ; Mon, 8 Jul 2002 10:39:57 -0700 (PDT) (envelope-from ximf@btinternet.com) Received: from host217-35-62-204.in-addr.btopenworld.com ([217.35.62.204] helo=IMFSYS) by rhenium.btinternet.com with smtp (Exim 3.22 #8) id 17RcUN-0007jr-00 for freebsd-smp@FreeBSD.org; Mon, 08 Jul 2002 18:39:55 +0100 Message-ID: <000501c226a6$81048960$0200a8c0@IMFSYS> From: "Alistair Cockeram" To: Subject: help Date: Sun, 7 Jul 2002 22:21:05 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0005_01C22604.95BB25F0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 Disposition-Notification-To: "Alistair Cockeram" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C22604.95BB25F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable test ------=_NextPart_000_0005_01C22604.95BB25F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
test
------=_NextPart_000_0005_01C22604.95BB25F0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Wed Jul 10 4:21:58 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 083BE37B400 for ; Wed, 10 Jul 2002 04:21:57 -0700 (PDT) Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACB3843E4A for ; Wed, 10 Jul 2002 04:21:56 -0700 (PDT) (envelope-from mtm@pacbell.net) Received: from kokeb.ambesa.net ([64.166.84.33]) by mta6.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GZ100E7D68KG9@mta6.snfc21.pbi.net> for freebsd-smp@freebsd.org; Wed, 10 Jul 2002 04:21:56 -0700 (PDT) Received: from kokeb.ambesa.net (tanstaafl@localhost [IPv6:::1]) by kokeb.ambesa.net (8.12.5/8.12.5) with ESMTP id g6ABLn6V000883 for ; Wed, 10 Jul 2002 04:21:49 -0700 (PDT envelope-from mtm@kokeb.ambesa.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.5/8.12.5/Submit) id g6ABLnXU000882; Wed, 10 Jul 2002 04:21:49 -0700 (PDT) Date: Wed, 10 Jul 2002 04:21:49 -0700 From: Mike Makonnen Subject: Getting resource limits out from under Giant To: freebsd-smp@freebsd.org Message-id: <20020710042149.26b39b62.makonnen@pacbell.net> MIME-version: 1.0 X-Mailer: Sylpheed version 0.7.8 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello folks, I took a stab at getting resource limits out from under Giant. The patch is at http://home.pacbell.net/makonnen/limits.giant.patch Comments? One thing I would like feedback on is the unconditional allocation of memory in fork1() to avoid allocating memory while holding the proc lock. Resource limits are copy-on-write by default and since the copy doesn't happen very often this leads to most times allocating a new struct plimit and just deallocating it a few lines later. I suspect that's probably not what we want. I can see a couple of ways to solve it, like keeping a preallocated pool or dropping, allocating the memory, and then re-aquiring the proc lock. Cheers, Mike Makonnen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Thu Jul 11 2: 3:58 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2386C37B400 for ; Thu, 11 Jul 2002 02:03:56 -0700 (PDT) Received: from amsfep12-int.chello.nl (amsfep12-int.chello.nl [213.46.243.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id DDDD043E31 for ; Thu, 11 Jul 2002 02:03:54 -0700 (PDT) (envelope-from Harold@drostp.nl) Received: from dnp-pdc.drostp.nl ([212.142.3.88]) by amsfep12-int.chello.nl (InterMail vM.5.01.03.06 201-253-122-118-106-20010523) with ESMTP id <20020711090354.VIHO28368.amsfep12-int.chello.nl@dnp-pdc.drostp.nl> for ; Thu, 11 Jul 2002 11:03:54 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3 content-class: urn:content-classes:message Subject: Date: Thu, 11 Jul 2002 11:12:09 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C228BB.08E4472E" Message-ID: <040F28299690B345B86908BFC2631B187036@dnp-pdc.drostp.nl> X-MS-Has-Attach: yes X-MS-TNEF-Correlator: Thread-Index: AcIouwg7IH9HI5auRGqof1PI29mMGA== From: "Harold de Bruijn" To: Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C228BB.08E4472E Content-Type: multipart/alternative; boundary="----_=_NextPart_002_01C228BB.08E4472E" ------_=_NextPart_002_01C228BB.08E4472E Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =20 Met vriendelijke groet, Drost & Partners =20 Harold de Bruijn =20 ------_=_NextPart_002_01C228BB.08E4472E Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
Met vriendelijke groet,
Drost & Partners
 
Harold de Bruijn
 
------_=_NextPart_002_01C228BB.08E4472E-- ------_=_NextPart_001_01C228BB.08E4472E Content-Type: text/x-vcard; name="Harold de Bruijn.vcf" Content-Transfer-Encoding: base64 Content-Description: Harold de Bruijn.vcf Content-Disposition: attachment; filename="Harold de Bruijn.vcf" QkVHSU46VkNBUkQNClZFUlNJT046Mi4xDQpOOmRlIEJydWlqbjtIYXJvbGQNCkZOOkhhcm9sZCBk ZSBCcnVpam4NCkVNQUlMO1BSRUY7SU5URVJORVQ6SGFyb2xkQGRyb3N0cC5ubA0KUkVWOjIwMDIw MjE5VDEzMjM1OFoNCkVORDpWQ0FSRA0K ------_=_NextPart_001_01C228BB.08E4472E-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Thu Jul 11 7:54:42 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77BC737B400; Thu, 11 Jul 2002 07:53:57 -0700 (PDT) Received: from excite.com (host134225.metrored.net.ar [200.59.134.225]) by mx1.FreeBSD.org (Postfix) with SMTP id B636A43E54; Thu, 11 Jul 2002 07:53:45 -0700 (PDT) (envelope-from Center_for_Age6414n05@excite.com) Received: from smtp013.mail.yahou.com ([29.16.108.187]) by mailout2-eri1.midmouth.com with esmtp; Thu, 11 Jul 0102 06:54:02 -0100 Received: from unknown (HELO mail.gimmixx.net) (155.22.111.109) by mta21.bigpong.com with SMTP; 11 Jul 0102 05:51:36 +1000 Received: from unknown (HELO rly-yk05.pesdets.com) (187.197.82.227) by n7.groups.huyahoo.com with asmtp; Thu, 11 Jul 0102 15:49:10 -0300 Received: from unknown (146.133.89.190) by symail.kustanai.co.kr with SMTP; 11 Jul 0102 12:46:44 -0000 Received: from 11.215.236.71 ([11.215.236.71]) by q4.quickslow.com with local; 11 Jul 0102 12:44:18 +0200 Reply-To: "Office" Message-ID: <025c34b26e3a$5734d7c4$5cb48da7@ajjqnx> From: "Office" To: Cc: , , , , , Subject: Three types of HGH products Date: Thu, 11 Jul 0102 12:53:21 +0200 MiME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00A3_62D23A1C.D7817E20" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 Importance: Normal Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org ------=_NextPart_000_00A3_62D23A1C.D7817E20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: base64 QXJlIEhHSCBwcm9kdWN0cyBkaWZmZXJlbnQ/DQoNCjxodG1sPg0KDQo8aGVh ZD4NCg0KPG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50 PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9d2luZG93cy0xMjUyIj4NCg0KPG1ldGEg bmFtZT0iR0VORVJBVE9SIiBjb250ZW50PSJNaWNyb3NvZnQgRnJvbnRQYWdl IDQuMCI+DQoNCjxtZXRhIG5hbWU9IlByb2dJZCIgY29udGVudD0iRnJvbnRQ YWdlLkVkaXRvci5Eb2N1bWVudCI+DQoNCjx0aXRsZT5UaGVyZSBhcmUgdGhy ZWUgZGlmZmVyZW50IHR5cGVzIG9mIEhHSCBwcm9kdWN0czwvdGl0bGU+DQoN CjwvaGVhZD4NCg0KPGJvZHkgYmFja2dyb3VuZD0iY2xvdWRzLmpwZyI+DQoN CjxwPjxmb250IHNpemU9IjQiPjxmb250IGNvbG9yPSIjODAwMDAw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m5ic3A7Jm5ic3A7Jm5ic3A7 Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7Jm5i c3A7IGZyZWUNCg0KSEdIIGNvbnN1bHRhdGlvbi48L3A+DQoNCjxwPjxicj4N Cg0KVGhhbmsgeW91PC9wPg0KDQo8L2JvZHk+DQoNCjwvaHRtbD4NCg0KIA0K IA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0K IA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0K IA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KIA0KDQot LQ0KDQo3NTg0bkJ3ZjItNjU3REd0VzYwMTRxQkd4My0yNjJ6bDI5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Fri Jul 12 1: 7:46 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 99D3937B400 for ; Fri, 12 Jul 2002 01:07:44 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30C9D43E4A for ; Fri, 12 Jul 2002 01:07:44 -0700 (PDT) (envelope-from mtm@pacbell.net) Received: from kokeb.ambesa.net ([64.173.11.248]) by mta7.pltn13.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GZ400HQIMKVHB@mta7.pltn13.pbi.net> for freebsd-smp@FreeBSD.ORG; Fri, 12 Jul 2002 01:07:43 -0700 (PDT) Received: from kokeb.ambesa.net (tanstaafl@localhost [IPv6:::1]) by kokeb.ambesa.net (8.12.5/8.12.5) with ESMTP id g6C87YaU020765; Fri, 12 Jul 2002 01:07:34 -0700 (PDT envelope-from mtm@kokeb.ambesa.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.5/8.12.5/Submit) id g6C87YWj020764; Fri, 12 Jul 2002 01:07:34 -0700 (PDT) Date: Fri, 12 Jul 2002 01:07:34 -0700 From: Mike Makonnen Subject: Re: Getting resource limits out from under Giant In-reply-to: <20020710042149.26b39b62.makonnen@pacbell.net> To: Mike Makonnen Cc: freebsd-smp@FreeBSD.ORG Message-id: <20020712010734.40b40b77.makonnen@pacbell.net> MIME-version: 1.0 X-Mailer: Sylpheed version 0.7.8 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT References: <20020710042149.26b39b62.makonnen@pacbell.net> Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Wed, 10 Jul 2002 04:21:49 -0700 Mike Makonnen wrote: > Hello folks, > > I took a stab at getting resource limits out from under Giant. > The patch is at http://home.pacbell.net/makonnen/limits.giant.patch > > Comments? Ok, I've broken it down into 3 separate diffs. http://home.pacbell.net/makonnen/limits.tar.gz 1. Touches sys/resourcevar.h - add a mutex to struct plimit - define 2 macros: LIM_LOCK and LIM_UNLOCK Touches kern/kern_resource.c - add 3 functions: limget(), limhold(), limfree() - modify limcopy() to take two arguments, the new and the old plimits structure. 2. Touches users of resource limits - These are exit1(), fork1(), proc0_init(), and acct_process() 3. Actually removes lock/unlock of Giant, and GIANT_REQUIRED Cheers, Mike Makonnen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Fri Jul 12 1:16:38 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BC63E37B4B3 for ; Fri, 12 Jul 2002 01:16:32 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 826CC43E31 for ; Fri, 12 Jul 2002 01:16:32 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 5EF5AAE23A; Fri, 12 Jul 2002 01:16:32 -0700 (PDT) Date: Fri, 12 Jul 2002 01:16:32 -0700 From: Alfred Perlstein To: Mike Makonnen Cc: freebsd-smp@FreeBSD.ORG Subject: Re: Getting resource limits out from under Giant Message-ID: <20020712081632.GJ97638@elvis.mu.org> References: <20020710042149.26b39b62.makonnen@pacbell.net> <20020712010734.40b40b77.makonnen@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020712010734.40b40b77.makonnen@pacbell.net> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org * Mike Makonnen [020712 01:07] wrote: > On Wed, 10 Jul 2002 04:21:49 -0700 > Mike Makonnen wrote: > > > Hello folks, > > > > I took a stab at getting resource limits out from under Giant. > > The patch is at http://home.pacbell.net/makonnen/limits.giant.patch > > > > Comments? > > Ok, I've broken it down into 3 separate diffs. > http://home.pacbell.net/makonnen/limits.tar.gz > > 1. Touches sys/resourcevar.h > - add a mutex to struct plimit > - define 2 macros: LIM_LOCK and LIM_UNLOCK > Touches kern/kern_resource.c > - add 3 functions: limget(), limhold(), limfree() > - modify limcopy() to take two arguments, the new and the old plimits > structure. > > 2. Touches users of resource limits > - These are exit1(), fork1(), proc0_init(), and acct_process() > > 3. Actually removes lock/unlock of Giant, and GIANT_REQUIRED Cool! Are you sure that no one can come in and mess with some other process's p->p_limit structure? If so you may need to protect it via the proc lock. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Fri Jul 12 2: 6:47 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BD4F237B400 for ; Fri, 12 Jul 2002 02:06:43 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65F1343E4A for ; Fri, 12 Jul 2002 02:06:43 -0700 (PDT) (envelope-from mtm@pacbell.net) Received: from kokeb.ambesa.net ([64.173.11.248]) by mta7.pltn13.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GZ400H2IPB6LU@mta7.pltn13.pbi.net> for freebsd-smp@FreeBSD.ORG; Fri, 12 Jul 2002 02:06:43 -0700 (PDT) Received: from kokeb.ambesa.net (tanstaafl@localhost [IPv6:::1]) by kokeb.ambesa.net (8.12.5/8.12.5) with ESMTP id g6C96XaU021103; Fri, 12 Jul 2002 02:06:33 -0700 (PDT envelope-from mtm@kokeb.ambesa.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.5/8.12.5/Submit) id g6C96XSe021102; Fri, 12 Jul 2002 02:06:33 -0700 (PDT) Date: Fri, 12 Jul 2002 02:06:33 -0700 From: Mike Makonnen Subject: Re: Getting resource limits out from under Giant In-reply-to: <20020712081632.GJ97638@elvis.mu.org> To: Alfred Perlstein Cc: freebsd-smp@FreeBSD.ORG Message-id: <20020712020633.6a66f187.makonnen@pacbell.net> MIME-version: 1.0 X-Mailer: Sylpheed version 0.7.8 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT References: <20020710042149.26b39b62.makonnen@pacbell.net> <20020712010734.40b40b77.makonnen@pacbell.net> <20020712081632.GJ97638@elvis.mu.org> Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 12 Jul 2002 01:16:32 -0700 Alfred Perlstein wrote: > > Cool! Are you sure that no one can come in and mess with some other > process's p->p_limit structure? If so you may need to protect > it via the proc lock. > Hmm... looks like I missed one. The vm system touches it. Other than that, it looks like all other references are just reading from it. In the case where there's a chance I might switch plimits structures I do a proc lock in addition to locking the limits structure. Otherwise, if all I'm doing is changing the value of one of the limits I only lock the limits structure itself. Is that not enough? Cheers, Mike. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Fri Jul 12 11: 9:39 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BFC1837B400 for ; Fri, 12 Jul 2002 11:09:36 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3214143E84 for ; Fri, 12 Jul 2002 11:09:36 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 4852 invoked from network); 12 Jul 2002 18:09:35 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 12 Jul 2002 18:09:35 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g6CI9Y036705; Fri, 12 Jul 2002 14:09:34 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020712020633.6a66f187.makonnen@pacbell.net> Date: Fri, 12 Jul 2002 14:09:32 -0400 (EDT) From: John Baldwin To: Mike Makonnen Subject: Re: Getting resource limits out from under Giant Cc: freebsd-smp@FreeBSD.ORG, Alfred Perlstein Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 12-Jul-2002 Mike Makonnen wrote: > On Fri, 12 Jul 2002 01:16:32 -0700 > Alfred Perlstein wrote: > >> >> Cool! Are you sure that no one can come in and mess with some other >> process's p->p_limit structure? If so you may need to protect >> it via the proc lock. >> > > Hmm... looks like I missed one. The vm system touches it. Other than > that, > it looks like all other references are just reading from it. > > In the case where there's a chance I might switch plimits structures > I do a proc lock in addition to locking the limits structure. Otherwise, > if all I'm doing is changing the value of one of the limits I only lock > the > limits structure itself. Is that not enough? You need to ensure you have a stable reference to the limits structure. If you are dereferencing p_limit you need to use the proc lock to protect reading that pointer. The lock also ensure the value is up to date. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Sat Jul 13 15:23:38 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CEBB37B400; Sat, 13 Jul 2002 15:23:35 -0700 (PDT) Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by mx1.FreeBSD.org (Postfix) with ESMTP id 21BA643E3B; Sat, 13 Jul 2002 15:23:35 -0700 (PDT) (envelope-from mtm@pacbell.net) Received: from kokeb.ambesa.net ([64.166.85.137]) by mta6.snfc21.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GZ700F2PKVAG3@mta6.snfc21.pbi.net>; Sat, 13 Jul 2002 15:23:35 -0700 (PDT) Received: from kokeb.ambesa.net (tanstaafl@localhost [IPv6:::1]) by kokeb.ambesa.net (8.12.5/8.12.5) with ESMTP id g6DMNK0Y006510; Sat, 13 Jul 2002 15:23:20 -0700 (PDT envelope-from mtm@kokeb.ambesa.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.5/8.12.5/Submit) id g6DMNKM1006509; Sat, 13 Jul 2002 15:23:20 -0700 (PDT) Date: Sat, 13 Jul 2002 15:23:19 -0700 From: Mike Makonnen Subject: Re: Getting resource limits out from under Giant In-reply-to: To: John Baldwin Cc: freebsd-smp@FreeBSD.ORG, bright@mu.org Message-id: <20020713152319.75c416a2.makonnen@pacbell.net> MIME-version: 1.0 X-Mailer: Sylpheed version 0.7.8 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT References: <20020712020633.6a66f187.makonnen@pacbell.net> Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Fri, 12 Jul 2002 14:09:32 -0400 (EDT) John Baldwin wrote: > > > You need to ensure you have a stable reference to the limits > structure. If you are dereferencing p_limit you need to use the proc > lock to protect reading that pointer. The lock also ensure the value > is up to date. > I see what you mean: foolimit = p->p_limit->pl_rlimit[FOOLIMIT].rlim_cur; is OK. But plim = p->p_limit; ... ... foolimit = p->p_limit->pl_rlimit[FOOLIMIT].rlim_cur; needs to lock both the proc and the limit. Even better, it should use the first form if it can. The part I am not clear about is when modifying a value in the limits structure. There is one instance in the patch where I do this: a: allocate some memory lock proc lock p->plimit check if we must copy-on-write do so if necessary unlock plimit unlock proc free some memory lock p->plimit if conditions have changed and we must do a copy-on-write goto a modify limits as necessary My reasoning for dropping both locks in the middle and reaquiring only the limit lock is that anyone who might mess with our p->plimit must aquire both the proc and the limit lock. So, as long as I have the limit lock, there isn't any chance that it will go stale on me. I will work on the patch some more this weekend and repost. Cheers, Mike Makonnen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Sat Jul 13 15:45: 5 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCCA537B400; Sat, 13 Jul 2002 15:45:03 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64E6943E42; Sat, 13 Jul 2002 15:45:03 -0700 (PDT) (envelope-from mtm@pacbell.net) Received: from kokeb.ambesa.net ([64.166.85.137]) by mta7.pltn13.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GZ7007QOLV2LO@mta7.pltn13.pbi.net>; Sat, 13 Jul 2002 15:45:03 -0700 (PDT) Received: from kokeb.ambesa.net (tanstaafl@localhost [IPv6:::1]) by kokeb.ambesa.net (8.12.5/8.12.5) with ESMTP id g6DMim0Y006630; Sat, 13 Jul 2002 15:44:48 -0700 (PDT envelope-from mtm@kokeb.ambesa.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.5/8.12.5/Submit) id g6DMimX4006629; Sat, 13 Jul 2002 15:44:48 -0700 (PDT) Date: Sat, 13 Jul 2002 15:44:48 -0700 From: Mike Makonnen Subject: Re: Getting resource limits out from under Giant In-reply-to: <20020713152319.75c416a2.makonnen@pacbell.net> To: Mike Makonnen Cc: jhb@FreeBSD.ORG, freebsd-smp@FreeBSD.ORG, bright@mu.org Message-id: <20020713154448.37b47d4a.makonnen@pacbell.net> MIME-version: 1.0 X-Mailer: Sylpheed version 0.7.8 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT References: <20020712020633.6a66f187.makonnen@pacbell.net> <20020713152319.75c416a2.makonnen@pacbell.net> Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, 13 Jul 2002 15:23:19 -0700 Mike Makonnen wrote: > On Fri, 12 Jul 2002 14:09:32 -0400 (EDT) > John Baldwin wrote: > > > > > > > You need to ensure you have a stable reference to the limits > > structure. If you are dereferencing p_limit you need to use the proc > > lock to protect reading that pointer. The lock also ensure the > > value is up to date. > > > > I see what you mean: > > foolimit = p->p_limit->pl_rlimit[FOOLIMIT].rlim_cur; > > is OK. But > > plim = p->p_limit; > ... > ... > foolimit = p->p_limit->pl_rlimit[FOOLIMIT].rlim_cur; uhh... I meant foolimit = plim->pl_rlimit[FOOLIMIT].rlim_cur; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Sat Jul 13 19:50:28 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F79937B400 for ; Sat, 13 Jul 2002 19:50:25 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id D996943E58 for ; Sat, 13 Jul 2002 19:50:24 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 6448 invoked from network); 14 Jul 2002 02:50:21 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 14 Jul 2002 02:50:21 -0000 Received: from laptop.baldwin.cx (laptop.baldwin.cx [192.168.0.4]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g6E2oA043207; Sat, 13 Jul 2002 22:50:10 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020713152319.75c416a2.makonnen@pacbell.net> Date: Sat, 13 Jul 2002 22:50:20 -0400 (EDT) From: John Baldwin To: Mike Makonnen Subject: Re: Getting resource limits out from under Giant Cc: bright@mu.org, freebsd-smp@FreeBSD.ORG Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 13-Jul-2002 Mike Makonnen wrote: > On Fri, 12 Jul 2002 14:09:32 -0400 (EDT) > John Baldwin wrote: > >> >> >> You need to ensure you have a stable reference to the limits >> structure. If you are dereferencing p_limit you need to use the proc >> lock to protect reading that pointer. The lock also ensure the value >> is up to date. >> > > I see what you mean: > > foolimit = p->p_limit->pl_rlimit[FOOLIMIT].rlim_cur; > > is OK. But > > plim = p->p_limit; > ... > ... > foolimit = p->p_limit->pl_rlimit[FOOLIMIT].rlim_cur; > > needs to lock both the proc and the limit. Even better, it should use > the first form if it can. > > The part I am not clear about is when modifying a value in the limits > structure. > There is one instance in the patch where I do this: > > a: > allocate some memory > lock proc > lock p->plimit > check if we must copy-on-write > do so if necessary > unlock plimit > unlock proc > free some memory > lock p->plimit > if conditions have changed and we must do a copy-on-write > goto a > modify limits as necessary > > My reasoning for dropping both locks in the middle and reaquiring only > the > limit lock is that anyone who might mess with our p->plimit must > aquire both the proc and the limit lock. So, as long as I have the limit > lock, there isn't any chance that it will go stale on me. > > I will work on the patch some more this weekend and repost. Why not just do a simple change: don't drop the locks so quick, but go ahead and do the modify limit step after using your preallocated memory to do the copy-on-write. Then you can drop your locks and free any memory using cached pointers. No need for a loop and much simpler. Basically, all you need to do is move your 'free some memory' step down to the bottom, then you can immediately go from the copy-on-write step to the modify limits step. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message From owner-freebsd-smp Sat Jul 13 22:21:52 2002 Delivered-To: freebsd-smp@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8045C37B400; Sat, 13 Jul 2002 22:21:50 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2992E43E67; Sat, 13 Jul 2002 22:21:50 -0700 (PDT) (envelope-from mtm@pacbell.net) Received: from kokeb.ambesa.net ([64.166.85.137]) by mta7.pltn13.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0GZ800J2348BM4@mta7.pltn13.pbi.net>; Sat, 13 Jul 2002 22:21:48 -0700 (PDT) Received: from kokeb.ambesa.net (tanstaafl@localhost [IPv6:::1]) by kokeb.ambesa.net (8.12.5/8.12.5) with ESMTP id g6E5LW0Y008069; Sat, 13 Jul 2002 22:21:32 -0700 (PDT envelope-from mtm@kokeb.ambesa.net) Received: (from mtm@localhost) by kokeb.ambesa.net (8.12.5/8.12.5/Submit) id g6E5LVQR008068; Sat, 13 Jul 2002 22:21:31 -0700 (PDT) Date: Sat, 13 Jul 2002 22:21:31 -0700 From: Mike Makonnen Subject: Re: Getting resource limits out from under Giant In-reply-to: To: John Baldwin Cc: bright@mu.org, freebsd-smp@FreeBSD.ORG Message-id: <20020713222131.6ebf07c8.makonnen@pacbell.net> MIME-version: 1.0 X-Mailer: Sylpheed version 0.7.8 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT References: <20020713152319.75c416a2.makonnen@pacbell.net> Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, 13 Jul 2002 22:50:20 -0400 (EDT) John Baldwin wrote: > > Why not just do a simple change: don't drop the locks so quick, but go > ahead and do the modify limit step after using your preallocated > memory to do the copy-on-write. Then you can drop your locks and free > any memory using cached pointers. No need for a loop and much > simpler. Basically, all you need to do is move your 'free some memory' > step down to the bottom, then you can immediately go from the > copy-on-write step to the modify limits step. > I do that in kern/kern_acct.c:acct_process(), which only requires an assignment statemt. But in kern/kern_resource.c:dosetrlimit() there are 2 reasons why I drop the proc lock. I will defer to your judgement as to whether they're valid or not. 1. There is one code path, when changing the stack size limit, where it goes off into vm land. I thought it might be better to drop the proc lock so that we don't unnecesarily block other threads. 2. I chose to use a mtx_pool mutex. My understanding is that I may not aquire another lock while holding one of these. But, as part of the stack size limit code path, we aquire a vm_map_lock. While I suppose I could use a regular mutex, I thought the additional complexity was worth the treadoff in structural/code overhead. Cheers, Mike Makonnen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message