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: Sat, 28 Oct 2006 14:55:00 +1000 [thread overview]
Message-ID: <4542E2A4.2080400@yahoo.com.au> (raw)
In-Reply-To: <1161938694.5019.83.camel@localhost.localdomain>
Richard Purdie wrote:
> On Fri, 2006-10-27 at 18:22 +1000, Nick Piggin wrote:
>
>>Richard Purdie wrote:
>>
>>>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.
>
>
> The code is subtly different to the swapoff code but I'll take another
> look and see if I can refactor it now I have it all working.
Subtly different code is the worst kind of code to be duplicating. It
really needs improving, I think.
>>Also, if you hit that BUG_ON, then you probably have a bug, don't
>>remove it!
>
>
> I gave that a lot of thought. We are in a write handler and have to
> handle the write error from there so the page will be marked as
> writeback. That function appears to be safe to call with that set
> through the new code path I added (which wouldn't have happened in the
> past). I therefore decided it was safe and the simplest solution was to
> remove the BUG_ON. If anyone can see a problem with a page being in
> writeback in that function, please enlighten me though!
It's just the wrong thing to do if the page has been set writeback with
a valid mapping. Presently we don't do any mapping specific accounting
in that path, but we could.
But now that I look at your patch, I don't think it is going to work.
end_swap_bio_write can be called from interrupt context, so you can't
lock the page, and you can't take any of those swap specific spinlocks
either.
You say that SetPageError makes the processes die unexpectedly? How and
where? We use SetPageError for IO errors, and it doesn't mean the page
has errors AFAIK.
The best policy would probably be to keep the end_page_writeback path as
it is, and then detect the PageError in the swap out path somewhere.
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
next prev parent reply other threads:[~2006-10-28 4:55 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
2006-10-27 8:44 ` Richard Purdie
2006-10-28 4:55 ` Nick Piggin [this message]
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=4542E2A4.2080400@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