Stephen Gran on 19 Dec 2007 17:20:39 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Pros and cons of swap in a partition vs. in a file in the file system


On Wed, Dec 19, 2007 at 03:19:15PM -0500, Jeff McAdams said:
> Walt Mankowski wrote:
> 
> > I always thought the main advantage of swap partitions over swap files
> > was speed.  All the bytes in a partition are continuous, so access
> > time is slightly higher than for a file created with dd, which can be
> > scattered over the disk.
> 
> There is that, there is also that it doesn't have to go through so much
> of the other sorts of processing in the kernel.  VFS, perhaps LVM,
> filesystem code, et al.  The hit here is pretty minor, but there is a bit.

The hit at this point is (almost) a pointer dereference per abstraction
layer, so very minimal.  That being said, Walt's point about scattering
of a file over the disk vs. ordered layout for a partition is accurate -
you can't do all that much to optimize scattered data.
-- 
 --------------------------------------------------------------------------
|  Stephen Gran                  | A lifetime isn't nearly long enough to  |
|  steve@lobefin.net             | figure out what it's all about.         |
|  http://www.lobefin.net/~steve |                                         |
 --------------------------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug