sounder 8, JS on Swap
Matt Zimmerman
mdz at canonical.com
Sun Sep 12 21:11:44 CDT 2004
On Mon, Sep 13, 2004 at 08:17:46AM +0800, John wrote:
> Matt Zimmerman wrote:
> >Swap partitions are faster than swap files for the simple reason that they
>
> I read recently that the swap subsystem on 2.6 is much improved and this
> doesn't apply any more.
I read that as well, but I can't find any technical information about the
changes behind it. My best guess is that there were improvements to reduce
the overhead of file allocation, but I doubt that it bypasses filesystem
journals and metadata, or causes the file to be allocated contiguously.
> I don't know how files are allocated in Linux, or whether it differes
> between filesystems (I expect it does), but the fact that the whole file
> is essentially created at the same time should help contiguity,
>
> Is there an easy way to check this for a particular file?
There is a block device ioctl that provides the map of blocks where a file
is stored.
> Using a swap partition, particularly in a system with many partitions
> (eg Sarge default) guaratantees lack of proximity.
Yes, but it provides other guarantees which are more compelling. Paging in
a range of memory from a swap partition should only require seeking over to
the swap area, reading some blocks, and seeking back. Reading from a swap
file involves a larger number of seeks, especially if the file is
discontiguous.
Anyway, if it turns out that the tradeoff has shifted in favour of swap
files, that's something to consider for a future release, so let's put this
discussion on hold until after Warty is out the door.
--
- mdz
More information about the sounder
mailing list