From owner-freebsd-current@FreeBSD.ORG Fri Jul 13 01:33:30 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0EB91106566B; Fri, 13 Jul 2012 01:33:30 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 88FD68FC0A; Fri, 13 Jul 2012 01:33:29 +0000 (UTC) Received: by qcsg15 with SMTP id g15so2207256qcs.13 for ; Thu, 12 Jul 2012 18:33:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; bh=J9lzbrPD07lW0bD1F9NokEnL7exyt5CQGPOgd9VzM9E=; b=IVK3gC2bY/3i0bEIpTDC0cUV9QIOLkV8pylGHWFqFO59wtsKiK8KGjbrBhZYD7v5sL 01PO7QZwaEVev/Uk1k3Bu6GvV44asX62HkpZOJpMTafmPu1b6zqU8QGnytAnWt4RB/rq uNqECtpzZ6SXdKe0knxr8qhCXcjod+jwggbovfCzGFvnJQdrzuJEpPZqdYWcir30tMEf k/zd9dT19ncAdz0OodlwRBU+rIshUrE+UrIwuYVQxNn3qwSjIRYzkiA/fwc0zNI7Fbr5 Mqn/+f/s7LMqVRJWxICEZGcEtR3hBRVoKWoB0CzS/kWx1SSYmo/waOWifNdWpjwpRSrQ RS+w== Received: by 10.224.176.204 with SMTP id bf12mr8429754qab.92.1342143208991; Thu, 12 Jul 2012 18:33:28 -0700 (PDT) Received: from triad.knownspace (pool-71-163-84-156.washdc.fios.verizon.net. [71.163.84.156]) by mx.google.com with ESMTPS id f14sm9232273qak.20.2012.07.12.18.33.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Jul 2012 18:33:28 -0700 (PDT) Message-Id: <307005B6-C8E5-4DCF-BD10-6BC79D8C2FE3@gmail.com> From: Justin Hibbits To: mdf@freebsd.org In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Thu, 12 Jul 2012 21:33:26 -0400 References: X-Mailer: Apple Mail (2.936) Cc: freebsd-current , FreeBSD PowerPC ML Subject: Re: panic with DEBUG_MEMGUARD on PowerPC 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: Fri, 13 Jul 2012 01:33:30 -0000 On Jul 12, 2012, at 9:11 PM, mdf@freebsd.org wrote: > On Thu, Jul 12, 2012 at 4:43 PM, Justin Hibbits > wrote: >> When tracking down a panic exposed by INVARIANTS, I tried setting >> DEBUG_MEMGUARD, so I could find the culprit that's trashing freed >> memory. >> However, this causes a panic at bootup. It shows up right after >> the first >> WARNING: WITNESS message, with the following: >> >> panic: kmem_suballoc: bad status return of 3 >> cpuid = 0 >> KDB: stack backtrace: >> 0xd0004ad0: at kdb_backtrace+0x4c >> 0xd0004b40: at panic+0x224 >> 0xd0004ba0: at kmem_suballoc+0x8c >> 0xd0004bd0: at kmeminit+0x1ac >> 0xd0004c20: at mi_startup+0x13c >> 0xd0004c50: at btext+0xc0 >> >> Tracing, and printf() debugging, I see arguments to >> vm_map_findspace(): >> start: 0xD0000000, length: 4246446080, and map->max_offset = >> 4026531839. >> >> Beyond that, I'm lost with tracking this down. Machine is a dual >> processor >> PowerPC G4, with 2GB RAM. > > The length is 0xFD1BA000 which is almost 4GB. Asking for 4GB of > virtual space for 2GB of RAM sounds about right (it's been a while > since I was in this code), unless this is a 32-bit kernel, in which > case it'd be too much since there isn't that much virtual space > available. > > So, is the kernel 32-bit? What are the values used and returned by > memguard_fudge()? The intent of that routine is to get kmeminit() to > allocate a larger map so memguard can use part of it for private > virtual addresses. But it shouldn't be asking for "too much"; i.e. > the intent was to check both physical and virtual space available and > be greedy, but not too greedy. > > There were some issues with that code for some platforms that e.g. > didn't define a VM_KMEM_SIZE_MAX, but alc@ fixed that in r216425. > > Thanks, > matthew It is a 32-bit kernel, on 32-bit hardware. The values for memguard_fudge are (defaults): tmp: 4246446080, vm_kmem_size: 117440512, vm_kmem_size_max: 0 When setting vm.kmem_size/vm.kmem_size_max to 2GB they are: tmp: 2147483648, vm_kmem_size: 214793648, vm_kmem_sizee_max: 2147483648 (all 2GB). But the start and map->max_offset remain the same on all runs I make. - Justin