On Fri, 2004-02-06 at 21:43, Jim Sibley wrote:

> It seems to me with a hierarchical swap structure
> (starting with the fastest as highest priority and
> going down to the slowest) that each time you fill a
> faster device then when your slower device kicks in,
> the is a disportinate decrease in performance. I
> suppose I would only use this scenario if I
> infrequently used the lower priority, slower device,
> using it as a safety valve, as it were.

Unless you're in a very stressed system, most swapping is write-once,
read-once. Normally we care about the speed of swap-in operations only
(though indirectly being able to swap out faster will allow you to
swap-in quicker again. A hierarchy of fast and slow disks might help if
you normally never go beyond the fastest disk, and occasionally overflow
that. But I also have seen that when you push Linux a bit it will start
to swap out things that it never needs again (until shutdown). It would
be a shame to have that sit on your fast disk.
I don't know whether many of us really have fast and slow disks, and
whether they know which are what. If you set up multiple swap disks with
same priority you increase the chance that you can do multiple swap
operations in parallel.

The exception to this is VDISK. I have been recommending a hierarchy of
VDISK. But that's not because of speed but because of footprint. As I
point out above, a swap page is normally read back in once and when the
process modifies the page the slot has become invalid. But z/VM does not
know that the page on VDISK will never be asked for again, and continues
to care for it and bring it to paging disk later. The page-in that z/VM
does when Linux refers to this slot again is pure waste. The way Linux
allocates slots on the swap device is likely to use unused slots rather
than re-use old slots, so this makes it worse.
By using a hierarchy you force Linux to re-use the freed slots rather
than make new pages on VDISK dirty.

Rob

Reply via email to