public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Richard Purdie <rpurdie@openedhand.com>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH, RFC/T] Fix handling of write failures to swap devices
Date: Fri, 27 Oct 2006 18:22:10 +1000	[thread overview]
Message-ID: <4541C1B2.7070003@yahoo.com.au> (raw)
In-Reply-To: <1161935995.5019.46.camel@localhost.localdomain>

Richard Purdie wrote:
> Fix handling of write failures to swap devices.
> 
> Calling SetPageError(page) marks the data in memory as bad and processes using
> the page in question will die unexpectedly. This isn't necessary as the data 
> in the memory page is still valid, just the copy on disk isn't. This patch 
> therefore removes this call.
> 
> Setting set_page_dirty(page) is good as the memory page will be retained and 
> processes don't die. It will try to write out the page again soon but a second 
> attempt at a write is probably no more likely to succeed than the first 
> resulting in IO loops. We can do better.
> 
> This patch attempts to unuse the page in a similar manner to swapoff. If 
> successful, mark the swap page as bad and remove it from use. If we fail to
> remove all references, we fall back on set_page_dirty above which will retry 
> the write.
> 
> If we can mark the swap page as bad, adjust the VM accounting to reflect this.
> 
> Signed-off-by: Richard Purdie <rpurdie@openedhand.com>
> 
> ---
> 
> Comments and testing from people who know this area of code better than
> me would be appreciated!

This is the right approach to handling swap write errors. However, you need
to cut down on the amount of code duplication. Also, if you hit that BUG_ON,
then you probably have a bug, don't remove it!

Otherwise, this would be nice to have so it's great you're working on it,
thanks.

-- 
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com 

  reply	other threads:[~2006-10-27  8:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-27  7:59 [PATCH, RFC/T] Fix handling of write failures to swap devices Richard Purdie
2006-10-27  8:22 ` Nick Piggin [this message]
2006-10-27  8:44   ` Richard Purdie
2006-10-28  4:55     ` Nick Piggin
2006-10-28 10:43       ` Richard Purdie
2006-10-28 12:10         ` Nick Piggin
2006-10-30 11:55           ` Richard Purdie
2006-11-01  5:26             ` Nick Piggin
2006-11-01  9:24               ` Richard Purdie
2006-11-02 23:26               ` Richard Purdie
2006-12-13 11:43               ` Richard Purdie
2006-11-01  5:36             ` Nick Piggin
2006-11-01  9:32               ` Richard Purdie
2006-10-27  9:35   ` Richard Purdie
2006-10-27 21:19 ` Andrew Morton

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=4541C1B2.7070003@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rpurdie@openedhand.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