From owner-freebsd-amd64@FreeBSD.ORG Sat Jul 23 19:17:26 2005 Return-Path: X-Original-To: freebsd-amd64@freebsd.org Delivered-To: freebsd-amd64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 256D716A41F for ; Sat, 23 Jul 2005 19:17:26 +0000 (GMT) (envelope-from peter@wemm.org) Received: from canning.wemm.org (canning.wemm.org [192.203.228.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0D1943D49 for ; Sat, 23 Jul 2005 19:17:23 +0000 (GMT) (envelope-from peter@wemm.org) Received: from fw.wemm.org (canning.wemm.org [192.203.228.65]) by canning.wemm.org (Postfix) with ESMTP id 7C54B2A8DA for ; Sat, 23 Jul 2005 12:17:23 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (overcee.wemm.org [10.0.0.3]) by fw.wemm.org (Postfix) with ESMTP id A6688E2B3 for ; Sat, 23 Jul 2005 12:17:22 -0700 (PDT) (envelope-from peter@wemm.org) Received: from overcee.wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (8.13.4/8.13.1) with ESMTP id j6NJHMqK070734; Sat, 23 Jul 2005 12:17:22 -0700 (PDT) (envelope-from peter@wemm.org) Received: from localhost (localhost [[UNIX: localhost]]) by overcee.wemm.org (8.13.4/8.13.1/Submit) id j6NJHLu9070733; Sat, 23 Jul 2005 12:17:21 -0700 (PDT) (envelope-from peter@wemm.org) X-Authentication-Warning: overcee.wemm.org: peter set sender to peter@wemm.org using -f From: Peter Wemm To: freebsd-amd64@freebsd.org Date: Sat, 23 Jul 2005 12:17:21 -0700 User-Agent: KMail/1.8.1 References: <42DFDCCA.8050207@he.iki.fi> <42DFF043.3090203@he.iki.fi> <200507231212.24708.peter@wemm.org> In-Reply-To: <200507231212.24708.peter@wemm.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200507231217.21681.peter@wemm.org> Cc: Petri Helenius Subject: Re: kernel memory X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2005 19:17:26 -0000 On Saturday 23 July 2005 12:12 pm, Peter Wemm wrote: > On Thursday 21 July 2005 11:58 am, Petri Helenius wrote: > > Peter Wemm wrote: > > >2GB for paged kernel memory. But in addition we access memory via > > > the direct map area to avoid the need for temporary mappings in > > > many cases. uma (malloc, mbufs) etc use this, as does the sfbuf > > > temporary mapping system. > > > > So there is no limitation for malloced memory? Say if my driver > > would like to have 4 or 8 gig lookup cache that would work? > > AARGH. I've just found a bug/feature in the memory allocator. > > There are two code paths, one for small ( which uses the direct map allocations instead of kvm allocations, and > the other large chunk allocator that simply allocates pages at a time > from kvm. :-( > > I suspect this is because malloc's semantics depend on objects being > contiguous. The direct map method would allocate physically > discontiguous pages. > > So, if you allocated your lookup cache in <4K chunks, you could have > as much as you like. :-/ Make that <= 4K. A 4K allocation should be fine. But I suspect that is still going to be a pain to deal with. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5