public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Troels Walsted Hansen" <troels@thule.no>
To: "'Andrew Morton'" <akpm@zip.com.au>
Cc: linux-kernel@vger.kernel.org
Subject: RE: [announce] swap mini-howto
Date: Sat, 2 Nov 2002 12:22:45 +0100	[thread overview]
Message-ID: <003401c28262$2d280ac0$0300000a@samurai> (raw)
In-Reply-To: <3DC3207A.450402B3@zip.com.au>

Andrew Morton wrote:
> Something I'd like to point out here:  in 2.4 and earlier, swapfiles
> are less robust than swap devices - the need to go and read metadata
> from the filesystem made them prone to oom deadlocks allocating pages
> and buffer_heads with which to perform the swapout.
> 
> That has changed in 2.5.  Swapping onto a regular file has no
> disadvantage wrt swapping onto a block device.  The kernel does
> not need to allocate any memory at all to get a swapcache page
> onto disk.
> 
> Which is interesting.  Because swapfiles are much easier to 
> administer,
> and much easier to stripe.  Adding, removing and resizing is 
> simplified.
> Distributors of 2.6-based kernels could consider doing away with
> swapdevs altogether.

Additionally, using a swapfile allows you to share swapspace with other
OSes.

This can be rather handy on a multibooting laptop with a small
harddrive.

I've done this successfully on a laptop multibooting RedHat 8.0 and
Windows XP. The procedure is quite simple:
 - Set up the Windows swapfile on a FAT32 partition, it will preallocate
the file as pagefile.sys (up to the minimum size that you specify).

 - Make sure the FAT32 partition gets mounted in /etc/fstab.

 - mkswap the pagefile.sys file in the Linux bootscripts before
swapfiles are turned on (Windows will trash the Linux swap signature).

 - Fortunately Windows will gladly use a swapfile trashed by Linux, so
there's no need to backup and restore any Windows swapfile headers.

One unfortunate disadvantage is that Windows hibernation to disk cannot
be used, since it assumes the contents of the pagefile are unmodified
when you resume.

Does anyone know if NTFS-TNG in 2.5 is robust enough to mount Windows XP
partitions and allow overwriting of existing files such as pagefile.sys?
If that is the case, the procedure is even easier because you can
eliminate the FAT32 partition and simply mount the main Windows XP
installation partition.

Troels


  parent reply	other threads:[~2002-11-02 11:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-01 23:58 [announce] swap mini-howto Randy.Dunlap
2002-11-02  0:09 ` Dave Jones
2002-11-02  0:07   ` Randy.Dunlap
2002-11-02  0:46   ` Andrew Morton
2002-11-02  8:26     ` Jeff Garzik
2002-11-02 10:02       ` Andrew Morton
2002-11-02 23:31         ` Jeff Garzik
2002-11-02 11:22     ` Troels Walsted Hansen [this message]
2002-11-04 10:47       ` Richard Russon
2002-11-02 16:55     ` Pavel Machek
2002-11-02 21:23       ` Rik van Riel
2002-11-02 21:28         ` Pavel Machek
2002-11-02  0:19 ` Andries Brouwer
2002-11-02  0:25   ` Randy.Dunlap
2002-11-02 11:19     ` Andries Brouwer
2002-11-05  5:54       ` [announce] swap mini-howto (updated) Randy.Dunlap
2002-11-02  1:01 ` [announce] swap mini-howto Nicolas Pitre
2002-11-02  1:23 ` Bernd Eckenfels
  -- strict thread matches above, loose matches on Subject: below --
2002-11-03 10:56 Gabor MICSKO

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='003401c28262$2d280ac0$0300000a@samurai' \
    --to=troels@thule.no \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /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