Subject: Sequential swap
To: None <current-users@NetBSD.ORG,>
From: Olaf Seibert <>
List: current-users
Date: 03/25/1995 00:06:57
Is it possible to configure the swap space such that it is used
sequentially instead of interleaved?

Currently, the 1.0 (i386, but I suppose that doesn't matter much)
kernel I'm running at work is using

config		netbsd root on wd0a swap on wd0b and sd0b

The only other partition on wd0 is a backup partition that is normally
not mounted, i.e. file system usage of wd0 is light and fs usage of sd0
can be heavy. Therefore I would prefer all the swap space on wd0b to be
used before that on sd0b.

There seem to be hooks in the kernel for this, so I tried the following
(with rather ill effects, I must admit). I added

option	SEQSWAP

which is used only in vm/vm_swap.c. I changed the config line to

config		netbsd root on wd0a swap on wd0b sequential and sd0b sequential

which is allowed in config syntax (but not Because it had
no effect on the generated swapnetbsd.c file, I edited the swdevt array
such that the 2nd member (sw_flags) became SW_SEQUENTIAL instead of the
hardcoded 0 that config provides. This seems both the intended effect
of config, and is what is tested inside vm_swap.c.

The generated kernel crashed, and in an attempt to dump, overwrote the
wd0 bookblocks. Thank ghod not the disklabel, since I didn't have a
copy of that. It was quite a panic, since this is supposed to be a
production system... Fortunately the boot floppies allowed me to
re-install the boot code.

Anyway, can it be done and if so, how?

___ Olaf 'Rhialto' Seibert         What's the use of
\X/  racism if you can't even see if a person belongs to your abhorred kind?