louis@sun.com (Louis Brune x403) (04/07/89)
Moderator, As you know from experience, having a large total swap area on two separate drives does improve performance. I posted our means of obtaining this primarily because it was long overdue for me to make at least a piddling contribution to a resource I value so highly. The line: config vmunix root on rf0 swap on rf0 and rf1 was pasted from the config file which configged with no errors and produced that machine's current working kernel. A similar line: config vmunix root on rf0 swap on rf0b and rf0d is in the corresponding file for this host. Since a copy of /usr/etc/config was not included in the additional distribution from our disk controller vendor, I suppose it's a 3.5 vs. 4.x glitch. The "rf" refers to the Ciprico RF3400 ESDI controller, but I don't think anything from that distribution is known at config time. None of our /etc/fstab files reference the swap partition (rf0b) on the same drive as the root. I'm relatively new at this, and I'm (happily?) constrained to avoid 4.x for now, but I submit that my config file is not "wrong", but only different or perhaps suited to an older system. [[ Okay. I won't argue with success. I didn't realize that you were running 3.x. By the same token, you didn't say which version you were running. You gave a "blind" answer and I responded. By the way, are you sure you are getting all your swap space? Use "/etc/pstat -s" and double check the amount. --wnl ]]
cks@white.toronto.edu (Chris Siebenmann) (04/26/89)
At least on Ultrix 2.2, I found out you had to do TWO things to get the kernel to swap on more than one partition: You had to build a kernel configured to swap on your chosen partitions. This has to be done because the kernel sizes up your total possible swap space (and allocates data structures based on this size) only at boot time. To do this, it has to look at how big each swap partition is, so it has to know what they are. For example, the config file for our fileserver (a Vaxserver 3600) has the config line # Our normal VMUNIX; two swap areas (drive 0 and drive 1) with the # root on drive 0. config vmunix root on ra0a swap on ra0b and ra1b dumps on ra0b to enable the kernel to swap on partition b of both our RA82 disks. However, when the system comes up, it only starts swapping on the first partition specified -- presumably this is so a single-user boot only relies on having one disk up and running, instead of all of the disks the kernel swaps on. So, you have to enable swapping on the additional partitions via the swapon(2) system call. This is done by using /etc/swapon in /etc/rc; usually "/etc/swapon -a" to take all the partitions of type swap from /etc/fstab and have the kernel start swapping on them. If you omit the config step, /etc/swapon gives an error (the kernel checks to see if the partition you're trying to start swapping on has been configured in and aborts if it hasn't). If you omit the /etc/swapon step, you get a kernel which is all ready to swap on additional partitions, but hasn't had them enabled yet. I hope this has been useful in clearing up some of the confusion. [Note: I have checked manpages on SunOS 3.5 and 4.0 systems, and swapon(2) and swapon(8) are documented there. I haven't actually had to configure a Sun for multi-partion swapping, but the 3.5 kernel source for that bit looks the same as the Ultrix and 4.3BSD source.] -- "I shall clasp my hands together and bow to the corners of the world." Number Ten Ox, "Bridge of Birds" Chris Siebenmann ...!utgpu!{ncrcan,ontmoh!moore}!ziebmef!cks cks@white.toronto.edu or ...!utgpu!{,csri!}cks [[ I don't know about anybody else, but when we configured a kernel for a 4.0.1 system, we had to use the following string in the config line: "swap on xy0b swap on xy1b". Using "and" was not sufficient. But we may have just been suffering from brain damage at the time. --wnl ]]