linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: John McCabe-Dansted <gmatht@gmail.com>
Cc: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: Compress=lzo a good idea for Swapfiles on SSD?
Date: Sat, 26 Mar 2011 08:54:07 -0400	[thread overview]
Message-ID: <1301143968-sup-9251@think> (raw)
In-Reply-To: <AANLkTi=b9hzJ5zs2qNm1ZbbkQLdmua8zQfJJhpVs4nYd@mail.gmail.com>

Excerpts from John McCabe-Dansted's message of 2011-03-25 23:47:02 -0400:
> I understand that modern SSDs can withstand a significant amount of
> writes, and so using an SSD for swap seems like a reasonable
> proposition. However minimising writes still seems like a good idea.
> My experience with compcache/ramzswap suggests that swap compresses
> quite well, I tend to get a 4:1 compression ratio. Furthermore, I
> understand that we can work around the data corruption that usually
> occurs when using a swapfile on a btrfs partion, by using a loopback
> device. Given this, my question is:
> 
> Does it sound like a good idea to use compress=lzo for swapfiles to
> reduce the amount of data written to the SSD, when using SSD drives
> that do not use compression internally?
> 

I would tend to say no, only because using compression leads to more
allocations required to actually write the blocks.  So you're swapping
because you need to free ram but you have to allocate ram in order to
swap.

There are projects for in kernel swapfile compression that have good
results though, so I'd have to study it in more detail.

-chris

      reply	other threads:[~2011-03-26 12:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26  3:47 Compress=lzo a good idea for Swapfiles on SSD? John McCabe-Dansted
2011-03-26 12:54 ` Chris Mason [this message]

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=1301143968-sup-9251@think \
    --to=chris.mason@oracle.com \
    --cc=gmatht@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).