lkml.org 
[lkml]   [2005]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Swap partition vs swap file
On 7/8/05, Andrew Morton <akpm@osdl.org> wrote:
> Mike Richards <mrmikerich@gmail.com> wrote:
> >
> > > > Given this situation, is there any significant performance or
> > > > stability advantage to using a swap partition instead of a swap file?
> > >
> > > In 2.6 they have the same reliability and they will have the same
> > > performance unless the swapfile is badly fragmented.
> >
> > Thanks for the reply -- that's been bugging me for a while now. There
> > are a lot of different opinions on the net, and most of the
> > conventional wisdom says use a partition instead of a file. It's nice
> > to hear from an expert on the matter.
> >
> > Three more short questions if you have time:
> >
> > 1. You specify kernel 2.6 -- What about kernel 2.4? How less reliable
> > or worse performing is a swapfile on 2.4?
>
> 2.4 is weaker: it has to allocate memory from the main page allocator when
> performing swapout. 2.6 avoids that.
>
> > 2. Is it possible for the swapfile to become fragmented over time, or
> > does it just keep using the same blocks over and over? i.e. if it's
> > all contiguous when you first create the swapfile, will it stay that
> > way for the life of the file?
>
> The latter. Create the swapfile when the filesystem is young and empty,

I guess/hope dd always makes it contiguously.

> it'll be nice and contiguous. Once created the kernel will never add or
> remove blocks. The kernel won't let you use a sparse file for a swapfile.
>

--
Coywolf Qi Hunt
http://ahbl.org/~coywolf/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-08 02:47    [W:0.062 / U:5.532 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site