From owner-cvs-all@FreeBSD.ORG Fri Mar 24 22:42:27 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D66E016A401; Fri, 24 Mar 2006 22:42:27 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from lh.synack.net (lh.synack.net [204.152.188.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E22C43D46; Fri, 24 Mar 2006 22:42:27 +0000 (GMT) (envelope-from jasone@FreeBSD.org) Received: by lh.synack.net (Postfix, from userid 100) id 586935E4913; Fri, 24 Mar 2006 14:42:27 -0800 (PST) Received: from [192.168.168.201] (moscow-cuda-gen2-68-64-60-20.losaca.adelphia.net [68.64.60.20]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lh.synack.net (Postfix) with ESMTP id 9DA585E4913; Fri, 24 Mar 2006 14:42:26 -0800 (PST) Message-ID: <442475D1.5010903@FreeBSD.org> Date: Fri, 24 Mar 2006 14:42:25 -0800 From: Jason Evans User-Agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= References: <200603232337.k2NNb6tH020675@repoman.freebsd.org> <86irq45etp.fsf@xps.des.no> <442444C4.8020404@elischer.org> <86k6ajpmvb.fsf@xps.des.no> In-Reply-To: <86k6ajpmvb.fsf@xps.des.no> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.0.5 (2005-11-28) on lh.synack.net X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=no version=3.0.5 Cc: cvs-all@FreeBSD.org, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Julian Elischer , Peter Wemm Subject: Re: cvs commit: src/lib/libc/sys mmap.2 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Mar 2006 22:42:27 -0000 Dag-Erling Smørgrav wrote: > Julian Elischer writes: > >>Dag-Erling Smørgrav wrote: >> >>>Are you saying that mmap() is not constrained by maxdsiz? >> >>that seems to be the case from my experience. > > > That's bad. Our new malloc() uses mmap() to allocate arenas, which > means that dsiz no longer has any effect. I've just confirmed this: > > # phkmalloc on 5.4 / i386 > % ulimit -d > 524288 > % ./allocate > 511 > > # jemalloc on 7.0 / i386 > % ulimit -d > 524288 > % ./allocate > 697 > > # jemalloc on 7.0 / amd64 > % ulimit -d > 524288 > % ./allocate > 1844^C > > Note the discrepancy on 7.0 / i386 - it does stop, but only after > exceeding dsiz by about 50%. On amd64, it'll happily keep going until > it hits vsiz, which is unlimited by default. By choosing a malloc size of 1MB in your test program, you just happened to pick the worst possible case for malloc chunk fragmentation (50% utilization). In reality, the reason that you hit a limit of 697 on i386 is that you used pretty much the entire mmap()able address space (2*697MB == 1394MB). On i386, jemalloc switches from sbrk() to mmap() when heap space runs out. Jason