public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Chris Samuel <chris@csamuel.org>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: btrfs and swap files on SSD's ?
Date: Mon, 19 Jan 2009 11:22:42 -0500	[thread overview]
Message-ID: <1232382162.6521.108.camel@think.oraclecorp.com> (raw)
In-Reply-To: <200901171110.22803.chris@csamuel.org>

On Sat, 2009-01-17 at 11:10 +1100, Chris Samuel wrote:
> Hi folks,
> 
> Someone on the OpenMoko community list commented recently about having created 
> a swap file on the SD card of their OpenMoko Neo phone and said that they'd 
> been lazy as they'd not made a swap partition.
> 
> My thought was that with an SSD aware filesystem like btrfs a swapfile would 
> actually be a smarter move than a swap partition because it lets the 
> filesystem try and even the wear generated by access to it which a swap 
> partition will not have the freedom to do.

It has actually been a while since I read through the swap-on-file code,
but setup_swap_extents() makes me think it is making its own map of the
blocks in use by the FS.

This doesn't quite play nicely with btrfs and should lead to all kinds
of problems....I'm looking into how to disable swapfiles completely.

> 
> To me that makes logical sense but given the complexity of the kernel and 
> btrfs is it a fair comment to make and, also, would that be the case with 
> btrfs at present ?

In general, the btrfs cow will be more wear leveling friendly but this
is the kind of thing that I'd expect the ssd to do for us ;)

<insert David Woodhouse's long standing debate with me about where wear
leveling should live here>

-chris



  reply	other threads:[~2009-01-19 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-17  0:10 btrfs and swap files on SSD's ? Chris Samuel
2009-01-19 16:22 ` Chris Mason [this message]
2009-01-20 10:41   ` Kaspar Schleiser
2009-01-20 13:02     ` Chris Mason
2009-01-20 13:51       ` Dmitri Nikulin
2009-01-20 14:31         ` Chris Mason
2009-01-20 16:35           ` Anthony Roberts
2009-01-20 16:41             ` Chris Mason
2009-01-21  6:15         ` Andi Kleen

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=1232382162.6521.108.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=chris@csamuel.org \
    --cc=linux-btrfs@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