The man page for dumpadm says this: A given ZFS volume cannot be configured for both the swap area and the dump device. And indeed when I try to use a zvol as both, I get: zvol cannot be used as a swap device and a dump device My question is, why not ? Thanks, John -- This message posted from opensolaris.org
John Cecere wrote:> The man page for dumpadm says this: > > A given ZFS volume cannot be configured for both the swap area and the dump device. > > And indeed when I try to use a zvol as both, I get: > > zvol cannot be used as a swap device and a dump device > > My question is, why not ?Swap is a normal ZVOL and subject to COW, checksum, compression (and coming soon encryption). Dump ZVOLs are preallocated contiguous space that are written to directly by the ldi_dump routines, they aren''t written to by normal ZIO transactions, they aren''t checksum''d - the compression is done by the dump layer not by ZFS. This is needed because when we are writing a crash dump we want as little as possible in IO the stack. -- Darren J Moffat
Darren, Thanks for the explanation. Would you object if I opened a bug on the zfs man page to include what you''ve written here ? Thanks again, John Darren J Moffat wrote:> John Cecere wrote: >> The man page for dumpadm says this: >> >> A given ZFS volume cannot be configured for both the swap area and the >> dump device. >> >> And indeed when I try to use a zvol as both, I get: >> >> zvol cannot be used as a swap device and a dump device >> >> My question is, why not ? > > Swap is a normal ZVOL and subject to COW, checksum, compression (and > coming soon encryption). > > Dump ZVOLs are preallocated contiguous space that are written to > directly by the ldi_dump routines, they aren''t written to by normal ZIO > transactions, they aren''t checksum''d - the compression is done by the > dump layer not by ZFS. This is needed because when we are writing a > crash dump we want as little as possible in IO the stack. > > -- > Darren J Moffat-- John Cecere Americas Technology Office / Sun Microsystems 732-302-3922 / john.cecere at sun.com
John Cecere wrote:> Darren, > > Thanks for the explanation. Would you object if I opened a bug on the > zfs man page to include what you''ve written here ?I don''t know if what I said is considered implementation detail or not. Feel free to log the bug but I can''t say either way if it would be considered appropriate for the man page. -- Darren J Moffat
Darren J Moffat wrote:> John Cecere wrote: > >> The man page for dumpadm says this: >> >> A given ZFS volume cannot be configured for both the swap area and the dump device. >> >> And indeed when I try to use a zvol as both, I get: >> >> zvol cannot be used as a swap device and a dump device >> >> My question is, why not ? >> > > Swap is a normal ZVOL and subject to COW, checksum, compression (and > coming soon encryption). > >Would there be no performance benefits from having swap read/write from contiguous preallocated space also? I do realize that nifty features like encryption might be lost in that case, but I"m wondering if there''s any performance to be gained? Then again if you''re concerned about performance you need to just buy ram till you stop swapping all together, huh? -Kyle> Dump ZVOLs are preallocated contiguous space that are written to > directly by the ldi_dump routines, they aren''t written to by normal ZIO > transactions, they aren''t checksum''d - the compression is done by the > dump layer not by ZFS. This is needed because when we are writing a > crash dump we want as little as possible in IO the stack. > > -- > Darren J Moffat > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >
Kyle McDonald wrote:> Darren J Moffat wrote: > >> John Cecere wrote: >> >> >>> The man page for dumpadm says this: >>> >>> A given ZFS volume cannot be configured for both the swap area and the dump device. >>> >>> And indeed when I try to use a zvol as both, I get: >>> >>> zvol cannot be used as a swap device and a dump device >>> >>> My question is, why not ? >>> >>> >> Swap is a normal ZVOL and subject to COW, checksum, compression (and >> coming soon encryption). >> >> >> > Would there be no performance benefits from having swap read/write from > contiguous preallocated space also? >Not really, if you have to swap, you have no performance. Period. You lose about 3 orders of magnitude of memory latency by going to disk. If one is 2x faster than another, you still can''t regain the orders of magnitude.> I do realize that nifty features like encryption might be lost in that > case, but I"m wondering if there''s any performance to be gained? > > Then again if you''re concerned about performance you need to just buy > ram till you stop swapping all together, huh? >Yes. Fast, inexpensive, reliable: pick two. -- richard
Richard Elling wrote:>> Would there be no performance benefits from having swap read/write >> from contiguous preallocated space also? >> > > Not really, if you have to swap, you have no performance. Period. > You lose about 3 orders of magnitude of memory latency by going to > disk. If one is 2x faster than another, you still can''t regain the orders > of magnitude.In addition to that you REALLY REALLY want protection of what ever you write to a swap device, so copies=2 or mirror/raidz pool config. Prior to ZFS the recommended best practice was to mirror your swap with a volume manager such as SVM. Having swap compressed could insome cases reduce the impact because you will do less IO to get more pages of RAM pagedout. Plus you really do want your swap encrypted if you have any encrypted datasets - otherwise you may have defeated the point of encrypted the datasets (depends on your whole system config and if your OS pool and data pool are the same and have the same physical access risks). -- Darren J Moffat