From owner-freebsd-arch@FreeBSD.ORG Tue Aug 5 09:42:06 2008 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6305110656A4 for ; Tue, 5 Aug 2008 09:42:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (ice.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 3C0D88FC22 for ; Tue, 5 Aug 2008 09:42:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 3649686B19 for ; Tue, 5 Aug 2008 04:23:39 -0500 (CDT) Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (ice.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 25495-07 for ; Tue, 5 Aug 2008 04:23:37 -0500 (CDT) Received: from wanderer.tachypleus.net (natr.physik.hu-berlin.de [141.20.47.46]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 691BC86AF7 for ; Tue, 5 Aug 2008 04:23:37 -0500 (CDT) Message-ID: <48981C19.8060009@freebsd.org> Date: Tue, 05 Aug 2008 11:23:37 +0200 From: Nathan Whitehorn User-Agent: Thunderbird 2.0.0.16 (X11/20080804) MIME-Version: 1.0 To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at ice.icecube.wisc.edu Subject: UMA MD Small Allocator Runtime Switching X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2008 09:42:06 -0000 I'm working on the PowerPC G5 port right now, and have run into a problem with the way the UMA small allocator works. On G3/G4 systems, there is a direct physical->virtual mapping, and on G5s there isn't. All of the infrastructure is in place to support both types of system with a single kernel image, except that UMA_MD_SMALL_ALLOC must be switched on/off at runtime. One solution is to put if (direct_map) use_nonsmall_case() into the MD small_alloc/free() routines and define UMA_MD_SMALL_ALLOC everywhere. This works well, except that the MI UMA code then sets booted = 1 too early in the boot process, before the kmem_alloc*() routines are available. Basically, I need to find a way have an MD UMA allocator without the MI UMA code assuming anything about how it works internally. Maybe adding a UMA_MD_ALLOC_LATE define to prevent setting booted=1 early on? -Nathan