public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Helge Hafting <helge.hafting@aitel.hist.no>
Cc: Marc Perkel <marc@perkel.com>, linux-kernel@vger.kernel.org
Subject: Re: Raid 0 Swap?
Date: Mon, 04 Sep 2006 14:29:16 +0400	[thread overview]
Message-ID: <44FBFFFC.90309@tls.msk.ru> (raw)
In-Reply-To: <44FBF62A.1010900@aitel.hist.no>

Helge Hafting wrote:
> Michael Tokarev wrote:
[]
>> If something with swap space goes wrong, God only knows what will break.
>> It is trivial to break userspace data this way, when an app is swapped
>> out and there's an error reading it from swap, its data file very likely
>> to be corrupt, especially when it is interrupted during file update.
>> It is probably possible to corrupt the whole filesystem this way too,
>> when some kernel memory has been swapped out and is needed to write some
>> parts of filesystem, but it can't be read back.
>>   
> I thought kernel data weren't swapped at all?
> Mostly because kernel data could be needed immediately, with
> no option of waiting for swapin. So, bad swap should only really kill
> userspace programs,
> although it probably can cause some bad delays in cases
> where the userspace program calls into the kernel,
> passing an address that happens to be in damaged swap.
> You might then stall the kernel holding some resources
> while the disks retries umpteen times.

Well, it's not that simple.  Kernel uses both swappable and
non-swappable memory internally.  For some things, it's
unswappable, for some, it's swappable.  In general, it's
impossible to say which parts of kernel will break (and
in wich ways) if swap goes havoc.

>> Ie, your swap space must be reliable.  At least not worse than your
>> memory.
>> And with striping, you've much more chances of disk failure...
>>   Yes it sounds very promising at first, to let kernel stripe swap space,
>> for faster operations.  But hell, first, try to avoid swappnig in the
>> first place, by installing appropriate amount memory which is cheap
>> nowadays, so there will be just no need for swapping.  And when it's
>> done, it's not relevant anymore whenever your swap space is fast or
>> not.  But make it *reliable*.
>>   
> Some swap is nice to have.  "Ouch - sluggish server today,
> I will have to look into it" is so much better
> than "Eww - the OOM serial killer took out another 5 processes,
> people are screaming!"

I didn't say "eliminate swap space", I said about trying to avoid
swap usage.  In the other words, DO set up swap space, and DO it
in a reliable way.  Not "swap isn't needed" - well yes, it's
not entirely clear from my statement.

> As for reliable swap - swap on raid-1 is nice - and it
> probably perform better than single-disk swap too,
> although not as fast as striped swap.

Yes it's slower.  But you don't really care, because in normal
life, there should be almost no swap usage.  When swapping starts
occuring in amounts where speed difference is noticeable, it's
time to add more memory (or to run less hungry processes),
not to speed up swap space.

/mjt

-- 
VGER BF report: H 0.182426

  reply	other threads:[~2006-09-04 10:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-03 22:43 Raid 0 Swap? Marc Perkel
2006-09-04  0:16 ` Bernd Eckenfels
2006-09-04  7:06 ` Michael Tokarev
2006-09-04  9:47   ` Helge Hafting
2006-09-04 10:29     ` Michael Tokarev [this message]
2006-09-04 10:46       ` Jan Engelhardt
2006-09-18  9:50         ` Denis Vlasenko
     [not found]           ` <e1a7ee0c0612272106y5e22dd21uc3f2fde567ab7532@mail.gmail.com>
2006-12-28  9:13             ` Jan Engelhardt
2007-01-01  2:08               ` Bill Davidsen
2006-09-04 15:29   ` Valdis.Kletnieks
2006-09-04 20:06     ` Bernd Eckenfels
2006-09-05 13:37       ` Helge Hafting
2006-09-05 23:44   ` Bill Davidsen
2006-09-06  6:53     ` Michael Tokarev
2006-09-06 17:21     ` Kyle Moffett
     [not found] <6R8WW-70v-7@gated-at.bofh.it>
     [not found] ` <6RgKP-1OA-9@gated-at.bofh.it>
2006-09-04 13:21   ` Bodo Eggert

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=44FBFFFC.90309@tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=helge.hafting@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc@perkel.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