From owner-freebsd-current@FreeBSD.ORG Sat Feb 18 18:32:16 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13F9A16A422 for ; Sat, 18 Feb 2006 18:32:16 +0000 (GMT) (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 735DF43D49 for ; Sat, 18 Feb 2006 18:32:15 +0000 (GMT) (envelope-from jasone@FreeBSD.org) Received: by lh.synack.net (Postfix, from userid 100) id 272DF5E48F2; Sat, 18 Feb 2006 10:32:15 -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 AB66D5E48BA; Sat, 18 Feb 2006 10:32:13 -0800 (PST) Message-ID: <43F7682B.7050604@FreeBSD.org> Date: Sat, 18 Feb 2006 10:32:11 -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: Brian Candler References: <20060215024339.N22450@atlantis.atlantis.dp.ua> <43F29BF5.4060300@freebsd.org> <20060216140725.T23429@atlantis.atlantis.dp.ua> <20060217013427.GB31540@xor.obsecurity.org> <20060217093631.J79078@atlantis.atlantis.dp.ua> <43F5F9BB.6000607@FreeBSD.org> <20060218083837.GB42791@uk.tiscali.com> In-Reply-To: <20060218083837.GB42791@uk.tiscali.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) 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.4 Cc: freebsd-current@freebsd.org Subject: Re: Virtual memory consumption (both user and kernel) in modern CURRENT 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: Sat, 18 Feb 2006 18:32:16 -0000 Brian Candler wrote: > Would it be possible to have some sort of "slow start" algorithm? For > example, first block allocated is 1MB, next block allocated is 4MB, > subsequent blocks are 16MB? > > I don't know anything about the internal data structures of jemalloc, but if > you treat "4MB" as 4 x 1MB and "16MB" as 16 x 1MB, then you'd have > effectively a pool of 1MB blocks, but apart from the first few, they'd be > allocated contiguously. Each chunk is aligned at an address that is a multiple of the chunk size. This makes it possible to use bitmasking to find the beginning of the containing chunk for any allocation in constant time, with no locking. This is critical to the correct, scalable functioning of the allocator. It would be possible to create chunks that are smaller than the standard chunk size, but they would still have to be aligned at multiples of the standard chunk size. This would leave trailing space that wouldn't be useful to the allocator. It would in some cases be possible to extend small chunks to the standard size, but this would cause some bad interactions with the layout policy (large objects are usually carved from the end of the chunk). As such, creating smaller chunks doesn't fit very well with the allocator design. Thanks, Jason