linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
To: Linux-MM <linux-mm@kvack.org>
Subject: Question: what happens if writeing back to swap ends in error
Date: Thu, 11 May 2006 10:49:01 +0900	[thread overview]
Message-ID: <20060511104901.572522a9.kamezawa.hiroyu@jp.fujitsu.com> (raw)

Hi,

What happens when I/O request from swap_writeback() ends in I/O Error ?

swap_writepage() (in mm/page_io.c) sets bio->bi_end_io as end_swap_bio_write().
After I/O ends, bio_endio()->end_swap_bio_write() is called, I think.

If that writeback was end in error, bio-bi_flags's BIO_UPTODATE is cleared.
Then, page is marked with PG_error.
==
static int end_swap_bio_write(struct bio *bio, unsigned int bytes_done, int err)
{
        const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
        struct page *page = bio->bi_io_vec[0].bv_page;

        if (bio->bi_size)
                return 1;

        if (!uptodate)
                SetPageError(page);
        end_page_writeback(page);
        bio_put(bio);
        return 0;
}
==
But here, PG_writeback is cleared, anyway.

Now, shrink_list() doesn't handle PG_error.
If the page is not accessed, page's state is !PageDirty() && !PageWriteback()
and SwapCache and on LRU.
Finally, page marked with PG_error is freed by shrink_list() and data in the
page will be lost.

correct ?

-Kame



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2006-05-11  1:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060511104901.572522a9.kamezawa.hiroyu@jp.fujitsu.com \
    --to=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.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