fiddle2 entry

< previous [home] next >

Date: 2008-06-09 15:28:44 (Author: trav)
Link: http://travis.kroh.net/archives/005038.php

On a lark, I was thinking about swap partitions. Specifically, I was wondering how FreeBSD used multiple swap partitions on different disks (or the same disk, for that matter—I've never tried putting multiple swap partitions on the same physical disk—I'm not even sure if you can). FreeBSD handbook to the rescue again:

...it is recommend that a swap is configured on each drive (up to four drives). The swap partitions should be approximately the same size. The kernel can handle arbitrary sizes but internal data structures scale to 4 times the largest swap partition. Keeping the swap partitions near the same size will allow the kernel to optimally stripe swap space across disks.

So it appears that it kind of treats the swap partitions like a striped RAID array, but that brings up a serious question: If it worked like a striped array, it would be subject to the same rules as RAID arrays, it would be something like "the internal data structures would scale to the number of partitions times the smallest partition size." But it doesn't. It says "4 times the largest swap partition." So that means the data structures knowingly can swell beyond available storage. I'm sure there's a good reason for it, and I'd like someone to tell me what it is and how it's done.

 

[ home - archives - quoteboard - blogger decoder - wishlist ]

Creative Commons License This work is licensed under a Creative Commons License.