Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jan 2000 12:05:00 +0300
From:      Alexey Zelkin <phantom@cris.net>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        current@FreeBSD.org
Subject:   Re: vn device strange behaviour
Message-ID:  <20000112120500.A7221@scorpion.crimea.ua>
In-Reply-To: <200001120141.RAA65875@apollo.backplane.com>
References:  <20000112013234.A28567@scorpion.crimea.ua> <200001120141.RAA65875@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000112120500.A7221>