From owner-freebsd-questions@FreeBSD.ORG Fri Jun 29 00:27:44 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F66E16A41F for ; Fri, 29 Jun 2007 00:27:44 +0000 (UTC) (envelope-from soconnor@falconknight.com) Received: from oasis.falconknight.com (oasis.falconknight.com [66.160.163.2]) by mx1.freebsd.org (Postfix) with ESMTP id 5DF8A13C468 for ; Fri, 29 Jun 2007 00:27:44 +0000 (UTC) (envelope-from soconnor@falconknight.com) Received: (qmail 24560 invoked from network); 28 Jun 2007 17:01:04 -0700 Received: from unknown (HELO ?192.168.1.3?) (71.189.127.178) by oasis.falconknight.com with SMTP; 28 Jun 2007 17:01:04 -0700 In-Reply-To: <200706290141.07063.pieter@degoeje.nl> References: <4D15FF0C-0531-4455-9631-F60D939F9EB2@falconknight.com> <200706290141.07063.pieter@degoeje.nl> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Shawn O'Connor Date: Thu, 28 Jun 2007 17:01:02 -0700 To: Pieter de Goeje X-Mailer: Apple Mail (2.752.2) Cc: freebsd-questions@freebsd.org Subject: Re: mdconfig using malloc() X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jun 2007 00:27:44 -0000 On Jun 28, 2007, at 4:41 PM, Pieter de Goeje wrote: > On Thursday 28 June 2007, Shawn O'Connor wrote: >> Guys, >> >> I'm trying to do the following: >> >> mdconfig -a -t malloc -o reserve -s 2g > You really don't want to do this. mdconfig will try to allocate 2G > of wired > memory, which will obviously fail, because you really don't have > that much > kernel memory available. This might work (with some tweaks) on a 64bit > platform however. I have 8GB of RAM on this machine. Wouldn't allocating 2GB of it to a RAM disk would be okay? It is an amd64. I found this options that I can change in the kernel config file. I think if I set them, I'll have enough KVM for this command to be performed. options VM_KMEM_SIZE_MAX=2684354560 options VM_KMEM_SIZE_SCALE=2 That should give me 2.5GB of KVM, from which I should be able to safely allocate 2GB to a RAM disk, right? >> >> Which fails saying it can't: >> >> mdconfig: ioctl(/dev/mdctl): Cannot allocate memory >> >> I saw some old post advocated using -t swap instead, saying that swap >> probably wouldn't be used until real memory was consumed. But, on my >> 6.2 machine that immediately raises the swap usage to 2GB and does >> use disk instead of RAM when I test using it. > That's because you used -o reserve. Leave it out and it'll be fine. When using with -o reserve and swap it returns immediately, just like with -t malloc without the -o reserve (except without the nasty repercussions of running out of RAM). My problem isn't that it uses the swap (nothing is using it anyway), but that it is using disk at all, which is way to slow for what I'm trying to do. Thanks for the help! -Shawn