linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Question: what happens if writeing back to swap ends in error
@ 2006-05-11  1:49 KAMEZAWA Hiroyuki
  0 siblings, 0 replies; only message in thread
From: KAMEZAWA Hiroyuki @ 2006-05-11  1:49 UTC (permalink / raw)
  To: Linux-MM

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>

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-11  1:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11  1:49 Question: what happens if writeing back to swap ends in error KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox