Subject: Re: Swap beginning with cylinder 0
To: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
From: Bill Studenmund <email@example.com>
Date: 05/22/1996 22:56:48
> After exchanging some email with Theo (Theo! gasp! :-) on the subject
> of this can of worms about reserving part of a swap area to avoid
> swapping over disk labels and the like, the alternative that seems best
> to me is to define a new ioctl for disk drivers. If we call this
> ioctl, for the sake of argument, DIOCSWAPSKIP, then the idea is that
> the swap code does a DIOCSWAPSKIP on the swap device to find out how
> much it should skip.
> In my opinion, the only real choice is to push it off into the driver.
> The amount to reserve has to be specific to at least the port, since,
> for example, the Amiga uses a comparatively large amount of space, two
> tracks or something - or so I'm told - while the sun3 port uses a fixed
> 8K and the i386 port uses ghod only knows how much, probably depending
> on whether it's a floppy or not or something equally weird. And while
> it could just be a port-specific constant, that can end up wasting a
> lot of space for ports that need a lot of space on boot disks but not
> when swap isn't at the beginning of the disk or when the disk isn't a
> boot disk or some such...and _definitely_ ends up wasting space when
> swapping on a vnd. And then there are ccds to consider; if a striped
> ccd component is being swapped on, and a component includes a boot
> area, you have to either skip multiple pieces of the ccd or you have to
> skip approximately N times as much where N is the number of components.
I like the idea, but on things like a ccd, if I understand it, it
(the ccd) already had to be skipping the boot area, no?
On the mac, we read the MacOS partition table, and then make a
disklabel from there, so none of the partitions contain the
boot blocks (or the partitoin table or the MacFS partitions...).
Thus for us, such an IOCTL would return 0.
I think this idea is good for more than just swap; filesystems
on the a partition could be told exactly how much to skip too
(a question for fs creation).