sounder 8, JS on Swap

John dingo at coco2.arach.net.au
Sun Sep 12 22:03:12 CDT 2004


Matt Zimmerman wrote:

>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.
>
>  
>

There was also a bit about improved access to files (unbuffered). I 
don't recall the details, but I recall at the time this looked like the 
mechanism it might use.


>There is a block device ioctl that provides the map of blocks where a file
>is stored.
>
>  
>
I was thinking of a commanline util. I tried debugs but it's beyond my 
comprehension.

>>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.
>
>  
>
One of the other issues is management of swap. If I go out and buy a new 
box now, it would likely have 256 or (more probably) 512 Mbytes of RAM.

Debending on what ROT you believe, I should have one or two bytes of 
swap for each byte of RAM. In a year or so, I will find it's hitting 
swap a bit, and RAM is "so cheap" I'll go out and buy twice as much 
again. I've done it many times before:-)

Now the ROT says I should increase swap to three times what I had in the 
first place.

Now the radical proponents of swap partitions will want me to increase 
the size of the swap partition. Tricky.
If I actually believed that rot, I'd go for a swap file.

OTOH I don't unconditionally believe the ROT, I'd be using a swap file 
whose size I can change whenever I feel the need. In this case, I'd 
remove it:-)

Put it on the list to review for Hoary, I can live with that. So long as 
_I_ don't _have_ to create a swap partition, and I don't.





More information about the sounder mailing list