From owner-freebsd-current@FreeBSD.ORG Tue Feb 19 18:58:09 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 C4B6216A469 for ; Tue, 19 Feb 2008 18:58:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 89F0C13C4D5 for ; Tue, 19 Feb 2008 18:58:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 9FD3946BC9; Tue, 19 Feb 2008 13:58:08 -0500 (EST) Date: Tue, 19 Feb 2008 18:58:08 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Jason Evans In-Reply-To: <47BB0D29.5080403@freebsd.org> Message-ID: <20080219185615.R21494@fledge.watson.org> References: <20080219151809.GF57366@rambler-co.ru> <47BB0D29.5080403@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Igor Sysoev , 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 18:58:09 -0000 On Tue, 19 Feb 2008, Jason Evans wrote: >> As sbrk() is less preferable because of framentation and race conditions, >> why not to create mmap() flag MMAP_DSS to check RLIMIT_DATA and to use it >> in malloc(3) ? > > There has been general agreement among the people I've discussed this issue > with that the correct solution is to add a separate resource limit for > anonymously mapped memory, which would provide capabilities similar to what > your suggestion would provide. Konstantine has updated his patches and reported on them in the recent status report: http://www.freebsd.org/news/status/report-2007-10-2007-12.html#VM-Overcommit Here's the main site for information on the patch: http://people.freebsd.org/~kib/overcommit/ He describes a per-uid limit, but I think it might also be useful to have a per-process limit tht can also be enforced, although possibly not by default, so that protecting applications from each other doesn't require creating separate users for them. Robert N M Watson Computer Laboratory University of Cambridge