Re: swap file vs swap partition



On 2009-09-17, celsius thomas <aarklon@xxxxxxxxx> wrote:

I have read here
(http://www.softpanorama.org/Internals/Filesystems/linux_swap_filesystem.shtml
)

that swapping to a file is slower than swapping to a partition , based
on the following reasons

1) large files(swap file) will be somewhat fragmented forcing
additional disk/head movement in some cases and that you will have to
deal with metadata describing where on the disk the file blocks are.
this eats up both in-system filesystem cache and causes additional disk
activity while you load metadata that is not in cache

is there any other reason that justifies this claim OR what exactly is
the tradeoff between a swap partition and a swap file ??

Well, in general (which the above touches on), with a swap file the
kernel has to deal with the overhead of the filesystem, whereas with
a partition there's no intervening filesystem to get in the way.

But either way, if you're doing a lot of swapping, to the point of
thrashing, the efficiency of your swap space isn't going to be a
primary concern. :) I think you should prefer a swap partition for
organizational reasons, but if you simply can't for some reason a swap
file is fine.

--keith

--
kkeller-usenet@xxxxxxxxxxxxxxxxxxxxxxxxxx
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information

.



Relevant Pages

  • Re: swap file vs swap partition
    ... that swapping to a file is slower than swapping to a partition, ... the tradeoff between a swap partition and a swap file ?? ... disk space is so cheap that I run with two 2 GByte swap partitions (one on each of two hard drives). ...
    (comp.os.linux.setup)
  • swap file vs swap partition
    ... that swapping to a file is slower than swapping to a partition, based on the following reasons ... is there any other reason that justifies this claim OR what exactly is the tradeoff between a swap partition and a swap file ?? ...
    (comp.os.linux.setup)
  • Re: swap file vs swap partition
    ... that swapping to a file is slower than swapping to a partition, ... on the following reasons ... the tradeoff between a swap partition and a swap file ?? ...
    (comp.os.linux.setup)
  • Re: swap file vs swap partition
    ... that swapping to a file is slower than swapping to a partition, ... on the following reasons ... the tradeoff between a swap partition and a swap file ?? ...
    (comp.os.linux.setup)
  • Re: Recommended sizes for file systems
    ... In the old days a swap partition was ... One of the enhancements in 2.6 is improved swapping. ... My Athlon has 512 Mbytes of RAM. ...
    (Fedora)

Loading