From owner-freebsd-current@FreeBSD.ORG Tue Feb 19 19:38:52 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537F116A421; Tue, 19 Feb 2008 19:38:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id DE58113C45A; Tue, 19 Feb 2008 19:38:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JRYIi-000BR4-2U; Tue, 19 Feb 2008 21:38:50 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id m1JJcK9O050704 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 19 Feb 2008 21:38:20 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m1JJcgmH074393; Tue, 19 Feb 2008 21:38:42 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m1JJcggs074392; Tue, 19 Feb 2008 21:38:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 19 Feb 2008 21:38:42 +0200 From: Kostik Belousov To: Robert Watson Message-ID: <20080219193842.GG57756@deviant.kiev.zoral.com.ua> References: <20080219151809.GF57366@rambler-co.ru> <47BB0D29.5080403@freebsd.org> <20080219185615.R21494@fledge.watson.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NZdDWKHbmnyWnFtu" Content-Disposition: inline In-Reply-To: <20080219185615.R21494@fledge.watson.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 6dc4245230f22f3abb357b69a6da667e X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2264 [Feb 19 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: Igor Sysoev , Jason Evans , freebsd-current@freebsd.org Subject: Re: malloc(3) ignores RLIMIT_DATA X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Feb 2008 19:38:52 -0000 --NZdDWKHbmnyWnFtu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 19, 2008 at 06:58:08PM +0000, Robert Watson wrote: >=20 > On Tue, 19 Feb 2008, Jason Evans wrote: >=20 > >>As sbrk() is less preferable because of framentation and race condition= s,=20 > >>why not to create mmap() flag MMAP_DSS to check RLIMIT_DATA and to use = it=20 > >>in malloc(3) ? > > > >There has been general agreement among the people I've discussed this=20 > >issue with that the correct solution is to add a separate resource limit= =20 > >for anonymously mapped memory, which would provide capabilities similar = to=20 > >what your suggestion would provide. >=20 > Konstantine has updated his patches and reported on them in the recent=20 > status report: >=20 > http://www.freebsd.org/news/status/report-2007-10-2007-12.html#VM-Overc= ommit >=20 > Here's the main site for information on the patch: >=20 > http://people.freebsd.org/~kib/overcommit/ >=20 > He describes a per-uid limit, but I think it might also be useful to have= a=20 > per-process limit tht can also be enforced, although possibly not by=20 > default, so that protecting applications from each other doesn't require= =20 > creating separate users for them. Yes, per-process limits can be added too, although it would require some additional thinking. The persistent objects backed by anonymous memory, like SysV shm or shm_open(2) handles would be billed for the creator only. It is not immediately obvious whether it is right or not. Anyway, I want to get the review first, before doing further modifications. --NZdDWKHbmnyWnFtu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAke7MEEACgkQC3+MBN1Mb4ikQgCfZrnzQ+FjqJHniRl/1KTOILm7 ymUAoNZmzI/NfVMhASNHC07i2dT4MxDc =7VSO -----END PGP SIGNATURE----- --NZdDWKHbmnyWnFtu--