From owner-freebsd-current@FreeBSD.ORG Thu Jan 22 14:40:00 2009 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 3383D106564A for ; Thu, 22 Jan 2009 14:40:00 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from people.fsn.hu (people.fsn.hu [195.228.252.137]) by mx1.freebsd.org (Postfix) with ESMTP id 93E918FC18 for ; Thu, 22 Jan 2009 14:39:58 +0000 (UTC) (envelope-from bra@fsn.hu) Received: from localhost (people [192.168.2.4]) by people.fsn.hu (Postfix) with SMTP id ABACB12AB42 for ; Thu, 22 Jan 2009 15:39:56 +0100 (CET) Received: from [172.16.129.134] (fw.axelero.hu [195.228.243.120]) by people.fsn.hu (Postfix) with ESMTP id 585D812AB3F for ; Thu, 22 Jan 2009 15:39:55 +0100 (CET) Message-ID: <4978853A.2000107@fsn.hu> Date: Thu, 22 Jan 2009 15:39:54 +0100 From: Attila Nagy User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: freebsd-current@FreeBSD.org X-Stationery: 0.4.8.12 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (people.fsn.hu [0.0.0.0]); Thu, 22 Jan 2009 15:39:55 +0100 (CET) X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Thu Jan 22 15:39:56 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 4978853c607582036610207 Cc: Subject: Creating swap based ramdisks from rc.initdiskless by default 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: Thu, 22 Jan 2009 14:40:00 -0000 Hello, In /etc/rc.initdiskless there is a function, which creates memory disks in diskless environments: # Create a generic memory disk # mount_md() { /sbin/mdmfs -S -i 4096 -s $1 -M md $2 } I have a lot of remote booted diskless and "with disks" machines, which rely on this kind of storage. The problem is that the above command specifies "-M", so it will create MD_MALLOC disks, which can't be swapped out, so it constantly takes away RAM, even if there is only a lightly used dataset on the storage, which could be in swap too in cases, when there is a memory pressure on the system. So the question is: what is the rationale behind creating malloc backed disks by default, instead of swap-backed ones? I can only think of two: - MD_SWAP disks cannot be created, if NO_SWAPPING is enabled in the kernel (I haven't checked, if the swap code is enabled (default) and there is no swap, I can create swap based disks, like malloc based ones) - under memory pressure, the swap based disks will be slow, so maybe it's not a goot idea to put /etc (in netbooted environment, this is by default on memory disks) onto it. BTW, I don't see the difference here between a netbooted machine, having /etc on a swap backed memory disk, which also holds swap and a locally booted machine, having /etc on a disk, which also holds swap. (of course there is a difference, if the swap is on another disk(s) So, are there any objections on changing /sbin/mdmfs -S -i 4096 -s $1 -M md $2 to /sbin/mdmfs -S -i 4096 -s $1 md $2 ?