public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Swap partition vs swap file
@ 2005-06-29  0:57 Mike Richards
  2005-06-29  5:03 ` Andrew Morton
  0 siblings, 1 reply; 19+ messages in thread
From: Mike Richards @ 2005-06-29  0:57 UTC (permalink / raw)
  To: linux-kernel

Is there any significant difference these days between a swap
partition and a swap file?

An exhaustive Google search turns up several conflicting answers. The
consensus seems to be that a swap partition is more efficient than a
swap file, but whether or not the difference is noteworthy is never
definitively answered.

For the sake of argument, let's assume you've got modern hardware with
ample RAM and a recent kernel (a late 2.4.x or 2.6.x), and that under
normal conditions you never seeing more than 50-100MB of swap used.

Given this situation, is there any significant performance or
stability advantage to using a swap partition instead of a swap file?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-06-29  0:57 Swap partition vs swap file Mike Richards
@ 2005-06-29  5:03 ` Andrew Morton
  2005-06-29 10:37   ` Marat Buharov
  2005-07-07 19:50   ` Mike Richards
  0 siblings, 2 replies; 19+ messages in thread
From: Andrew Morton @ 2005-06-29  5:03 UTC (permalink / raw)
  To: Mike Richards; +Cc: linux-kernel

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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-06-29  5:03 ` Andrew Morton
@ 2005-06-29 10:37   ` Marat Buharov
  2005-06-29 11:46     ` Douglas McNaught
  2005-07-07 19:50   ` Mike Richards
  1 sibling, 1 reply; 19+ messages in thread
From: Marat Buharov @ 2005-06-29 10:37 UTC (permalink / raw)
  To: linux-kernel

Hmm, but what about tells mkswap(8) tells:
"...Note that a swap file must not contain any holes (so, using  cp
(1) to create the file is not acceptable)..."?

If swap file will be fragmented it will contain holes.
Or what type of holes can cp(1) can create, which are not usefull for mkswap(8)?

2005/6/29, Andrew Morton <akpm@osdl.org>:
> 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.
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-06-29 10:37   ` Marat Buharov
@ 2005-06-29 11:46     ` Douglas McNaught
  0 siblings, 0 replies; 19+ messages in thread
From: Douglas McNaught @ 2005-06-29 11:46 UTC (permalink / raw)
  To: Marat Buharov; +Cc: linux-kernel

Marat Buharov <marat.buharov@gmail.com> writes:

> Hmm, but what about tells mkswap(8) tells:
> "...Note that a swap file must not contain any holes (so, using  cp
> (1) to create the file is not acceptable)..."?
>
> If swap file will be fragmented it will contain holes.

No, holes are actual missing blocks (which are read as zeros) while
fragmentation just means the blocks of the file are not contiguous on
disk.

-Doug

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-06-29  5:03 ` Andrew Morton
  2005-06-29 10:37   ` Marat Buharov
@ 2005-07-07 19:50   ` Mike Richards
  2005-07-07 21:59     ` Andrew Morton
  1 sibling, 1 reply; 19+ messages in thread
From: Mike Richards @ 2005-07-07 19:50 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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

3. Does creating the swapfile on a journaled filesystem (e.g. ext3 or
reiser) incur a significant performance hit?

Thanks again. It's much appreciated.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-07 19:50   ` Mike Richards
@ 2005-07-07 21:59     ` Andrew Morton
  2005-07-08  0:44       ` Coywolf Qi Hunt
  0 siblings, 1 reply; 19+ messages in thread
From: Andrew Morton @ 2005-07-07 21:59 UTC (permalink / raw)
  To: Mike Richards; +Cc: linux-kernel

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

> 3. Does creating the swapfile on a journaled filesystem (e.g. ext3 or
> reiser) incur a significant performance hit?

None at all.  The kernel generates a map of swap offset -> disk blocks at
swapon time and from then on uses that map to perform swap I/O directly
against the underlying disk queue, bypassing all caching, metadata and
filesystem code.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-07 21:59     ` Andrew Morton
@ 2005-07-08  0:44       ` Coywolf Qi Hunt
  2005-07-08  1:22         ` Bernd Eckenfels
  0 siblings, 1 reply; 19+ messages in thread
From: Coywolf Qi Hunt @ 2005-07-08  0:44 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Mike Richards, linux-kernel

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/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-08  0:44       ` Coywolf Qi Hunt
@ 2005-07-08  1:22         ` Bernd Eckenfels
  2005-07-08 15:35           ` Jeremy Nickurak
  0 siblings, 1 reply; 19+ messages in thread
From: Bernd Eckenfels @ 2005-07-08  1:22 UTC (permalink / raw)
  To: linux-kernel

In article <2cd57c9005070717446dcc52a1@mail.gmail.com> you wrote:
> I guess/hope dd always makes it contiguously.

No, it is creating files by appending just like any other file write. One
could think about a call to create unfragmented files however since this is
not always working best is to create those files young or defragment them
before usage.

Gruss
Bernd

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-08  1:22         ` Bernd Eckenfels
@ 2005-07-08 15:35           ` Jeremy Nickurak
  2005-07-08 21:35             ` Helge Hafting
  2005-07-08 22:41             ` Wakko Warner
  0 siblings, 2 replies; 19+ messages in thread
From: Jeremy Nickurak @ 2005-07-08 15:35 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 540 bytes --]

On ven, 2005-07-08 at 03:22 +0200, Bernd Eckenfels wrote:
> No, it is creating files by appending just like any other file write. One
> could think about a call to create unfragmented files however since this is
> not always working best is to create those files young or defragment them
> before usage.

Except that this defeats one of the biggest advantages a swap file has
over a swap partition: the ability to easilly reconfigure the amount of
hd space reserved for swap.

-- 
Jeremy Nickurak <atrus@lkml.spam.rifetech.com>

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-08 15:35           ` Jeremy Nickurak
@ 2005-07-08 21:35             ` Helge Hafting
  2005-07-08 22:41             ` Wakko Warner
  1 sibling, 0 replies; 19+ messages in thread
From: Helge Hafting @ 2005-07-08 21:35 UTC (permalink / raw)
  To: Jeremy Nickurak; +Cc: linux-kernel

On Fri, Jul 08, 2005 at 09:35:58AM -0600, Jeremy Nickurak wrote:
> On ven, 2005-07-08 at 03:22 +0200, Bernd Eckenfels wrote:
> > No, it is creating files by appending just like any other file write. One
> > could think about a call to create unfragmented files however since this is
> > not always working best is to create those files young or defragment them
> > before usage.
> 
> Except that this defeats one of the biggest advantages a swap file has
> over a swap partition: the ability to easilly reconfigure the amount of
> hd space reserved for swap.

You can still reconfigure the amount of swap by creating more swapfiles
later - you merely risk a fragmented file.  Keep your filesystems only
half full though, and it won't be a big problem. 
:-)

Helge Hafting


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-08 15:35           ` Jeremy Nickurak
  2005-07-08 21:35             ` Helge Hafting
@ 2005-07-08 22:41             ` Wakko Warner
  2005-07-09 22:59               ` Eric Sandall
  1 sibling, 1 reply; 19+ messages in thread
From: Wakko Warner @ 2005-07-08 22:41 UTC (permalink / raw)
  To: Jeremy Nickurak; +Cc: linux-kernel

Jeremy Nickurak wrote:
> On ven, 2005-07-08 at 03:22 +0200, Bernd Eckenfels wrote:
> > No, it is creating files by appending just like any other file write. One
> > could think about a call to create unfragmented files however since this is
> > not always working best is to create those files young or defragment them
> > before usage.
> 
> Except that this defeats one of the biggest advantages a swap file has
> over a swap partition: the ability to easilly reconfigure the amount of
> hd space reserved for swap.

Of course, now this begs the question: Is it possible to create a large file
w/o actually writing that much to the device (ie uninitialized).  There's
absolutely no reason that a swap file needs to be fully initialized, only
part which mkswap does.  Of course, I would expect that ONLY root beable to
do this. (or capsysadmin or whatever the caps are)

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-08 22:41             ` Wakko Warner
@ 2005-07-09 22:59               ` Eric Sandall
  2005-07-10  1:45                 ` Wakko Warner
  0 siblings, 1 reply; 19+ messages in thread
From: Eric Sandall @ 2005-07-09 22:59 UTC (permalink / raw)
  To: Wakko Warner; +Cc: Jeremy Nickurak, linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 8 Jul 2005, Wakko Warner wrote:
> Jeremy Nickurak wrote:
>> On ven, 2005-07-08 at 03:22 +0200, Bernd Eckenfels wrote:
>>> No, it is creating files by appending just like any other file write. One
>>> could think about a call to create unfragmented files however since this is
>>> not always working best is to create those files young or defragment them
>>> before usage.
>>
>> Except that this defeats one of the biggest advantages a swap file has
>> over a swap partition: the ability to easilly reconfigure the amount of
>> hd space reserved for swap.
>
> Of course, now this begs the question: Is it possible to create a large file
> w/o actually writing that much to the device (ie uninitialized).  There's
> absolutely no reason that a swap file needs to be fully initialized, only
> part which mkswap does.  Of course, I would expect that ONLY root beable to
> do this. (or capsysadmin or whatever the caps are)

That would make the swap file fragment as it's used, instead of
allocating one big file (the entire file) at once (and hopefully get
one contiguous chunk of the disk).

- -sandalle

- --
Eric Sandall                     |  Source Mage GNU/Linux Developer
eric@sandall.us                  |  http://www.sourcemage.org/
http://eric.sandall.us/          |  SysAdmin @ Inst. Shock Physics @ WSU
http://counter.li.org/  #196285  |  http://www.shock.wsu.edu/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFC0FbfHXt9dKjv3WERApKjAJ9ZObnrYWCmTyZW0ChggtgGjTKIvQCfbnvm
/U4zfjTYqMxEd5vmIRe1wbM=
=smCj
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-09 22:59               ` Eric Sandall
@ 2005-07-10  1:45                 ` Wakko Warner
  2005-07-10  2:14                   ` Bernd Eckenfels
  0 siblings, 1 reply; 19+ messages in thread
From: Wakko Warner @ 2005-07-10  1:45 UTC (permalink / raw)
  To: Eric Sandall; +Cc: Jeremy Nickurak, linux-kernel

Eric Sandall wrote:
> >Of course, now this begs the question: Is it possible to create a large 
> >file
> >w/o actually writing that much to the device (ie uninitialized).  There's
> >absolutely no reason that a swap file needs to be fully initialized, only
> >part which mkswap does.  Of course, I would expect that ONLY root beable to
> >do this. (or capsysadmin or whatever the caps are)
> 
> That would make the swap file fragment as it's used, instead of
> allocating one big file (the entire file) at once (and hopefully get
> one contiguous chunk of the disk).

You misunderstood entirely what I said.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-10  1:45                 ` Wakko Warner
@ 2005-07-10  2:14                   ` Bernd Eckenfels
  2005-07-10 12:54                     ` Wakko Warner
  0 siblings, 1 reply; 19+ messages in thread
From: Bernd Eckenfels @ 2005-07-10  2:14 UTC (permalink / raw)
  To: linux-kernel

In article <20050710014559.GA15844@animx.eu.org> you wrote:
> You misunderstood entirely what I said.

There is no portable/documented way to grow a file without having the file
system null its content. However why is that a problem, you dont create
those files very often. Besides it is better for the OS to be able to asume
that a page with zeros in it is equal to the page on fresh swap.

Gruss
Bernd

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-10  2:14                   ` Bernd Eckenfels
@ 2005-07-10 12:54                     ` Wakko Warner
  2005-07-10 21:40                       ` Bernd Eckenfels
  2005-07-11 11:10                       ` Helge Hafting
  0 siblings, 2 replies; 19+ messages in thread
From: Wakko Warner @ 2005-07-10 12:54 UTC (permalink / raw)
  To: Bernd Eckenfels; +Cc: linux-kernel

Bernd Eckenfels wrote:
> In article <20050710014559.GA15844@animx.eu.org> you wrote:
> > You misunderstood entirely what I said.
> 
> There is no portable/documented way to grow a file without having the file
> system null its content. However why is that a problem, you dont create
> those files very often. Besides it is better for the OS to be able to asume
> that a page with zeros in it is equal to the page on fresh swap.

So are you saying that if I create a swap partition it's best to use dd to
zero it out before mkswap?  If no, then why would a file be different?  I
know there's no documented way to create a file of given size without
writing content.  I saw windows grow a pagefile several meg in less than a
second so I'm sure that it doesn't zero out the space first.

As far as portable, we're talking about linux, portability is not an issue
in this case.  I myself don't use swap files (or partitions), however, there
was a project I recall that would dynamically add/remove swap as needed. 
Creating a file of 20-50mb quickly would have been beneficial.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-10 12:54                     ` Wakko Warner
@ 2005-07-10 21:40                       ` Bernd Eckenfels
  2005-07-11 11:10                       ` Helge Hafting
  1 sibling, 0 replies; 19+ messages in thread
From: Bernd Eckenfels @ 2005-07-10 21:40 UTC (permalink / raw)
  To: linux-kernel

In article <20050710125438.GA17784@animx.eu.org> you wrote:
> So are you saying that if I create a swap partition it's best to use dd to
> zero it out before mkswap?

Nope I did not. However I dont know of any other shell tool which can do it
that easyly.

> As far as portable, we're talking about linux, portability is not an issue
> in this case. 

Portability across Filesystems.

Gruss
Bernd

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-10 12:54                     ` Wakko Warner
  2005-07-10 21:40                       ` Bernd Eckenfels
@ 2005-07-11 11:10                       ` Helge Hafting
  2005-07-12 21:53                         ` Wakko Warner
  1 sibling, 1 reply; 19+ messages in thread
From: Helge Hafting @ 2005-07-11 11:10 UTC (permalink / raw)
  To: Wakko Warner; +Cc: Bernd Eckenfels, linux-kernel

Wakko Warner wrote:

>Bernd Eckenfels wrote:
>  
>
>>In article <20050710014559.GA15844@animx.eu.org> you wrote:
>>    
>>
>>>You misunderstood entirely what I said.
>>>      
>>>
>>There is no portable/documented way to grow a file without having the file
>>system null its content. However why is that a problem, you dont create
>>those files very often. Besides it is better for the OS to be able to asume
>>that a page with zeros in it is equal to the page on fresh swap.
>>    
>>
You don't need to zero out swapfiles. You can fill them with anything,
even /dev/urandom.  Zero-filling may be faster though.  A swapfile
is not zero the second time you use it - then it contains leftovers
from last time.

>
>So are you saying that if I create a swap partition it's best to use dd to
>zero it out before mkswap?  If no, then why would a file be different?  I
>know there's no documented way to create a file of given size without
>writing content.  I saw windows grow a pagefile several meg in less than a
>second so I'm sure that it doesn't zero out the space first.
>  
>
Linux doesn't grow swapfiles at all.  It uses what's there at mkswap time.
You can make new ones of course - manually.

>As far as portable, we're talking about linux, portability is not an issue
>in this case.  I myself don't use swap files (or partitions), however, there
>was a project I recall that would dynamically add/remove swap as needed. 
>Creating a file of 20-50mb quickly would have been beneficial.
>  
>
You can create 50M quickly - even if it actually have to be written.  If
you can't, don't use that device for swap. 

Ability to allocate some blocks without actually writing to them is nice 
for this
purpose, but current linux filesystems doesn't have an api for doing that.
The necessary changes would touch all existing writeable filesystems, and
that is a lot of work for very little gain.  As they say, you don't 
create swapfiles
all that often.  The time saved on swapfile creation might take a long 
time to
make up for the time spent on making, auditing and supporting those
changes.

Helge Hafting





^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-11 11:10                       ` Helge Hafting
@ 2005-07-12 21:53                         ` Wakko Warner
  2005-07-13 10:58                           ` Jan Engelhardt
  0 siblings, 1 reply; 19+ messages in thread
From: Wakko Warner @ 2005-07-12 21:53 UTC (permalink / raw)
  To: Helge Hafting; +Cc: Bernd Eckenfels, linux-kernel

Helge Hafting wrote:
> Wakko Warner wrote:
> You don't need to zero out swapfiles. You can fill them with anything,
> even /dev/urandom.  Zero-filling may be faster though.  A swapfile
> is not zero the second time you use it - then it contains leftovers
> from last time.

I understand this part.

> >So are you saying that if I create a swap partition it's best to use dd to
> >zero it out before mkswap?  If no, then why would a file be different?  I
> >know there's no documented way to create a file of given size without
> >writing content.  I saw windows grow a pagefile several meg in less than a
> >second so I'm sure that it doesn't zero out the space first.
>
> Linux doesn't grow swapfiles at all.  It uses what's there at mkswap time.
> You can make new ones of course - manually.

And this part.  I've never known linux to grow the swap file.  I did try the
sparse one a long time ago.  Of course it didn't work.

> >As far as portable, we're talking about linux, portability is not an issue
> >in this case.  I myself don't use swap files (or partitions), however, 
> >there
> >was a project I recall that would dynamically add/remove swap as needed. 
> >Creating a file of 20-50mb quickly would have been beneficial.
>
> You can create 50M quickly - even if it actually have to be written.  If
> you can't, don't use that device for swap. 

Not all systems can create 50mb in a short time.  Especially when the
system/device is under load.  Not all systems have multiple disks either.

> Ability to allocate some blocks without actually writing to them is nice 
> for this
> purpose, but current linux filesystems doesn't have an api for doing that.
> The necessary changes would touch all existing writeable filesystems, and
> that is a lot of work for very little gain.  As they say, you don't 
> create swapfiles
> all that often.  The time saved on swapfile creation might take a long 
> time to
> make up for the time spent on making, auditing and supporting those
> changes.

I hadn't considered this "portability" so I didn't understand at that
point.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: Swap partition vs swap file
  2005-07-12 21:53                         ` Wakko Warner
@ 2005-07-13 10:58                           ` Jan Engelhardt
  0 siblings, 0 replies; 19+ messages in thread
From: Jan Engelhardt @ 2005-07-13 10:58 UTC (permalink / raw)
  To: Wakko Warner; +Cc: Helge Hafting, Bernd Eckenfels, linux-kernel

>> Linux doesn't grow swapfiles at all.  It uses what's there at mkswap time.
>> You can make new ones of course - manually.
>
>And this part.  I've never known linux to grow the swap file.  I did try the
>sparse one a long time ago.  Of course it didn't work.

I can't remember where exactly I read it but: when swapon is called, a 
fixed-size(determined at swapon) bitmap of the swap blocks is generated (to 
cope with fragementation of swapfiles). 
Can somebody confirm this?


Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2005-07-13 11:03 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-29  0:57 Swap partition vs swap file Mike Richards
2005-06-29  5:03 ` Andrew Morton
2005-06-29 10:37   ` Marat Buharov
2005-06-29 11:46     ` Douglas McNaught
2005-07-07 19:50   ` Mike Richards
2005-07-07 21:59     ` Andrew Morton
2005-07-08  0:44       ` Coywolf Qi Hunt
2005-07-08  1:22         ` Bernd Eckenfels
2005-07-08 15:35           ` Jeremy Nickurak
2005-07-08 21:35             ` Helge Hafting
2005-07-08 22:41             ` Wakko Warner
2005-07-09 22:59               ` Eric Sandall
2005-07-10  1:45                 ` Wakko Warner
2005-07-10  2:14                   ` Bernd Eckenfels
2005-07-10 12:54                     ` Wakko Warner
2005-07-10 21:40                       ` Bernd Eckenfels
2005-07-11 11:10                       ` Helge Hafting
2005-07-12 21:53                         ` Wakko Warner
2005-07-13 10:58                           ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox