From owner-freebsd-stable@FreeBSD.ORG Fri May 28 01:26:13 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 018921065675 for ; Fri, 28 May 2010 01:26:13 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id B0A248FC08 for ; Fri, 28 May 2010 01:26:12 +0000 (UTC) Received: by qyk11 with SMTP id 11so992936qyk.13 for ; Thu, 27 May 2010 18:26:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tgLqOEyyFKgPnH9DNuw+5aGtWSqI5mS+FyxKsWuFw3s=; b=j3yNOudIJtsWee/Vzc5uiqLc4AJ0wuAf+DKWUAGdXTRBBRxqI2OdA8v5ppxK3HJo6L GOlsowYJJgqsCjEm5psiiW19qhiR8/AG6DuYrAAUl4k0eQbnjqHfCG7SPs/7IhftpLvI 64qHeoHiUqfnY+L7v7JYH/WkmxkPc38eK6uT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=YyySDprwnAH7GJm957DYs6KTyzURNPhLin2fw8Vpd0O+jqvANZcGjC9OP8oKcMLQWh jIkdfX/j6FCmrSxAJBwrSwam1pukHNh47oaX6v16vgdFRqaJ9qF2cYnG0Yen79eEXU6V mNNKWD0Jbf3mQmgCy8CQcEr5Ie+ftqSVxyF58= MIME-Version: 1.0 Received: by 10.229.228.77 with SMTP id jd13mr2496046qcb.177.1275009971802; Thu, 27 May 2010 18:26:11 -0700 (PDT) Received: by 10.229.190.83 with HTTP; Thu, 27 May 2010 18:26:11 -0700 (PDT) In-Reply-To: <201005272348.o4RNmgWh014243@hugeraid.jetcafe.org> References: <201005272348.o4RNmgWh014243@hugeraid.jetcafe.org> Date: Thu, 27 May 2010 18:26:11 -0700 Message-ID: From: Garrett Cooper To: Dave Hayes Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org Subject: Re: Locking a file backed mdconfig into memory X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 01:26:13 -0000 On Thu, May 27, 2010 at 4:48 PM, Dave Hayes wrote: > On FreeBSD 7.3-STABLE I'm mounting a DVD and doing something like > this: > > =A0mdconfig -a -t vnode -o reserve -o readonly -f /dvd/file > > so that /dvd/file becomes the backing storage for my memory > disk. > > Now if the system is under severe memory pressure, will this > memory get swapped out, causing a read from the DVD? What swap? Need more details... > How would I tell the system to never swap this file out of ram, even unde= r > severe memory pressure? You might be misunderstanding the purpose of the -t option for mdconfig(8): -t type Select the type of the memory disk. malloc Storage for this type of memory disk is allocated wit= h malloc(9). This limits the size to the malloc bucket limit in the kernel. If the -o reserve option is not set, creating and filling a large malloc-backed memor= y disk is a very easy way to panic a system. vnode A file specified with -f file becomes the backing sto= re for this memory disk. swap Storage for this type of memory disk is allocated fro= m buffer memory. Pages get pushed out to the swap when the system is under memory pressure, otherwise they s= tay in the operating memory. Using swap backing is gener= - ally preferable over malloc backing. -t vnode points to a file, not to memory. I have no idea how that file is being backed though on the machine.. > The idea is to load this backing storage once and only once > from the DVD into memory and leave it there. I think you wanted -t malloc -o reserve, maybe based on your description ab= ove. HTH, -Garrett