public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Coywolf Qi Hunt <coywolf@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Mike Richards <mrmikerich@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: Swap partition vs swap file
Date: Fri, 8 Jul 2005 08:44:28 +0800	[thread overview]
Message-ID: <2cd57c9005070717446dcc52a1@mail.gmail.com> (raw)
In-Reply-To: <20050707145944.3ad8a1ab.akpm@osdl.org>

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/

  reply	other threads:[~2005-07-08  0:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cd57c9005070717446dcc52a1@mail.gmail.com \
    --to=coywolf@gmail.com \
    --cc=akpm@osdl.org \
    --cc=coywolf@lovecn.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mrmikerich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox