From owner-freebsd-current Wed Jan 12 3:50:12 2000 Delivered-To: freebsd-current@freebsd.org Received: from ccssu.crimea.ua (ccssu.ccssu.crimea.ua [62.244.13.130]) by hub.freebsd.org (Postfix) with ESMTP id 8196415253 for ; Wed, 12 Jan 2000 03:49:59 -0800 (PST) (envelope-from phantom@scorpion.crimea.ua) Received: (from uucp@localhost) by ccssu.crimea.ua (8.9.3/8.9.0) with UUCP id NAA09831; Wed, 12 Jan 2000 13:31:40 +0200 Received: (from phantom@localhost) by scorpion.crimea.ua (8.8.8/8.8.5+ssl+keepalive) id MAA17839; Wed, 12 Jan 2000 12:05:00 +0300 (MSK) Date: Wed, 12 Jan 2000 12:05:00 +0300 From: Alexey Zelkin To: Matthew Dillon Cc: current@FreeBSD.org Subject: Re: vn device strange behaviour Message-ID: <20000112120500.A7221@scorpion.crimea.ua> References: <20000112013234.A28567@scorpion.crimea.ua> <200001120141.RAA65875@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.7i In-Reply-To: <200001120141.RAA65875@apollo.backplane.com> X-Operating-System: FreeBSD 2.2.7-RELEASE i386 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, On Tue, Jan 11, 2000 at 05:41:59PM -0800, Matthew Dillon wrote: > :I just discovered some strange points about using vn devices (files) as > :swap devices. > : > :I have placed below some output gathered with script(1) and now > :some comments. > : > :1) I can easy unconfigure vn device which already mounted as swap device > :and then remove swapfile without any problems. I not sure about behaviour > :of the swapper when it will try to allocate swap from /dev/vn0c. > : > :2) When I am creating small file (about 100k) and try to mount it as swap > :device swapinfo(8) output looks broken. > : > :3) I could not mount three and more vn devices as swap devices. > : > :BTW, I also got strange results once (but I could not reporoduce it later): > :swapinfo(8) shown that I have three swap devices mounted: /dev/wd0s1b, > :/dev/rvn0c and /dev/#46:10. What's that ? I'll try to reproduce it again, > :but ... > : > :Comments ? > > Don't unconfigure a VN device mounted as swap unless you want your > system to die a horrible death. It shouldn't allow it to happen, but > it does and that's a bug. Yep, I think swapon(8) should fail in this case with something like "File is busy". > The first 128K of any swap partition is left alone by the swap subsystem > in order to ensure that the disklabel (if any) is not overwritten. Do > not configure tiny swap spaces -- apart from being useless they will > cause swapinfo to print confusing output. Why swapon(8) not handling that situation ? I mean check for vn device and its file size and then generating fatal error if its size less than 128k. Is it possible ? > By default the kernel is configured to support 4 SWAP partitions. How can I enable more swaps ? > Therefore you can only configure a maximum of 4 SWAP partiions. You > can change this in the kernel config. Note however that setting the > number arbitrarily high will cause a huge amount of KVM to be wasted. > Four is usually enough for anyone. BTW, I have described following porblem: I have one physical swap slice and tried to create three additional swapfiles. But I could not. System allowed me to create only 2 swapfiles, not 3 as you noted above. -- /* Alexey Zelkin && phantom@cris.net */ /* Tavric National University && phantom@crimea.edu */ /* http://www.ccssu.crimea.ua/~phantom && phantom@FreeBSD.org */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message