From owner-freebsd-current@FreeBSD.ORG Mon Sep 24 09:55:22 2007 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4116E16A41B; Mon, 24 Sep 2007 09:55:22 +0000 (UTC) (envelope-from rermilov@team.vega.ru) Received: from mail.vega.ru (mx1.vega.ru [87.242.77.163]) by mx1.freebsd.org (Postfix) with ESMTP id D238013C45A; Mon, 24 Sep 2007 09:55:21 +0000 (UTC) (envelope-from rermilov@team.vega.ru) Received: from [87.242.97.68] (port=62185 helo=edoofus.dev.vega.ru) by mail.vega.ru with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68 (FreeBSD)) (envelope-from ) id 1IZk3Q-0003QQ-Jm; Mon, 24 Sep 2007 09:16:36 +0000 Received: from edoofus.dev.vega.ru (localhost [127.0.0.1]) by edoofus.dev.vega.ru (8.14.1/8.14.1) with ESMTP id l8O9FxKQ048768; Mon, 24 Sep 2007 13:15:59 +0400 (MSD) (envelope-from rermilov@team.vega.ru) Received: (from ru@localhost) by edoofus.dev.vega.ru (8.14.1/8.14.1/Submit) id l8O9Fw4K048767; Mon, 24 Sep 2007 13:15:58 +0400 (MSD) (envelope-from rermilov@team.vega.ru) X-Authentication-Warning: edoofus.dev.vega.ru: ru set sender to rermilov@team.vega.ru using -f Date: Mon, 24 Sep 2007 13:15:58 +0400 From: Ruslan Ermilov To: Kris Kennaway Message-ID: <20070924091558.GB32006@team.vega.ru> References: <20070921102946.T11189@borg> <46F415BF.9010500@FreeBSD.org> <20070921140550.D96923@thebighonker.lerctr.org> <46F41CFF.6080108@FreeBSD.org> <46F58799.1030702@freebsd.org> <46F58B21.8030307@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46F58B21.8030307@FreeBSD.org> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Darren Reed , freebsd-current@FreeBSD.org, Larry Rosenman Subject: Re: panic: kmem_malloc(131072): kmem_map too small (AMD64) 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: Mon, 24 Sep 2007 09:55:22 -0000 On Sat, Sep 22, 2007 at 11:37:37PM +0200, Kris Kennaway wrote: > Darren Reed wrote: >> Kris Kennaway wrote: >>> Larry Rosenman wrote: >>>> On Fri, 21 Sep 2007, Kris Kennaway wrote: >>>> >>>>> Larry Rosenman wrote: >>>>>> I'm a heavy ZFS user, and got the following panic on 2007-09-18 >>>>>> source/world: >>>>> >>>>> This is a FAQ, please see the archives (you need to increase the >>>>> vm.kmem_size to provide more memory to ZFS). >>>> >>>> I thought that was only for i386, and it hadn't been an issue before. >>> >>> Nope. It is also load-dependent. >> So I just received this courtesy of ZFS: >> panic: kmem_malloc(131072): kmem_map too small: 343027712 total allocated >> cpuid = 0 >> KDB: enter: panic >> This was with these settings in loader.conf: >> vm.kmem_size=419430400 >> vm.kmem_size_max=419430400 Setting both doesn't make sense; kmem_size will take over. kmem_size_max only limits the automatically computed value of kmem_size, which is: /* * How many physical pages per KVA page allocated. * min(max(max(VM_KMEM_SIZE, Physical memory/VM_KMEM_SIZE_SCALE), * VM_KMEM_SIZE_MIN), VM_KMEM_SIZE_MAX) * is the total KVA space allocated for kmem_map. */ >> vfs.zfs.arc_max=409715200 >> (That's 400M, 400M and 40M, respectively.) >> Stupid question, perhaps, but is vm.kmem_size/vm.kmem_size_max limited by >> physical RAM? > > Yes. > To be precise, it's actually limited by 2 * sizeof(physical RAM). It's still size of a _virtual_ memory map (kmem_map), after all: : /* : * Limit kmem virtual size to twice the physical memory. : * This allows for kmem map sparseness, but limits the size : * to something sane. Be careful to not overflow the 32bit : * ints while doing the check. : */ : if (((vm_kmem_size / 2) / PAGE_SIZE) > cnt.v_page_count) : vm_kmem_size = 2 * cnt.v_page_count * PAGE_SIZE; Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer