From owner-freebsd-ppc@FreeBSD.ORG Mon Feb 25 03:11:27 2013 Return-Path: Delivered-To: ppc@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1EE5C3CA; Mon, 25 Feb 2013 03:11:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id D053C989; Mon, 25 Feb 2013 03:11:26 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0MIR00K00A3J8G00@smtpauth2.wiscmail.wisc.edu>; Sun, 24 Feb 2013 21:11:20 -0600 (CST) X-Spam-PmxInfo: Server=avs-2, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.2.25.30325, SenderIP=0.0.0.0 X-Spam-Report: AuthenticatedSender=yes, SenderIP=0.0.0.0 Received: from wanderer.tachypleus.net (adsl-76-208-68-53.dsl.mdsnwi.sbcglobal.net [76.208.68.53]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MIR00DMXA6RQB20@smtpauth2.wiscmail.wisc.edu>; Sun, 24 Feb 2013 21:11:17 -0600 (CST) X-Wisc-Sender: whitehorn@wisc.edu Message-id: <512AD653.2070603@freebsd.org> Date: Sun, 24 Feb 2013 21:11:15 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130217 Thunderbird/17.0.2 To: Alan Cox Subject: Re: kernel address space and auto-sizing References: <512AAB65.1000402@rice.edu> <512AB347.4030603@freebsd.org> <512AD5AD.3090303@rice.edu> In-reply-to: <512AD5AD.3090303@rice.edu> Cc: Kostik Belousov , ppc@freebsd.org, grehan@freebsd.org X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2013 03:11:27 -0000 On 02/24/13 21:08, Alan Cox wrote: > On 02/24/2013 18:41, Nathan Whitehorn wrote: >> This is bringing back bad memories. Let me explain about >> VM_MAX_SAFE_KERNEL_ADDRESS and mmu_oea64.c briefly. >> >> mmu_oea64 is the PMAP code for both PPC32 and PPC64 running on 64-bit >> CPUs. Both AIM32 and AIM64 in general have a direct map. *However*, >> 32-bit kernels running on 64-bit CPUs do *not* have a direct map. >> >> The memory layout when the kernel is booted is has the low 4 GB >> organized into 16 256 MB segments. We keep all firmware mappings and try >> to fit in a direct map. Segments 12 and 13 (0xc, 0xd) are guaranteed to >> be free. OF allocates its own mappings at the end of segment 14 (0xe). >> Everything else can't be touched. Without a direct map, having only 512 >> MB of KVA causes the kernel to regularly run out of VA space -- this was >> crashing package building. To ameliorate that, I added the >> MAX_SAFE_ADDRESS stuff and it then expands the KVA space from there into >> segment 14 until it finds memory the firmware is actually using and ends >> KVA there. I suspect this patch will cause a return to the crashing. Did >> I miss something? > > Let's ignore the patch for the moment. Have you tried booting a 32-bit > kernel on a 64-bit CPU since Andre's commit changing the mbuf > auto-sizing? As I mention below, 32-bit AIM defines VM_KMEM_SIZE to 12 > MB. Before Andre's commit, we sized the kmem submap as VM_KMEM_SIZE > plus sufficient space for the maximum number of mbuf clusters, > nmbclusters. Now, after Andre's change, nmbclusters hasn't been > computed at the point the kmem submap is created. Since 32-bit AIM > doesn't define VM_KMEM_SIZE_SCALE, the kmem submap will be stuck at 12 MB. No, only 64-bit kernels. I'll give it a try tomorrow unless someone else beats me to it. -Nathan