summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-12 00:16:04 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-12 00:16:04 -0700
commitb1c72a96797037b7e62c1fc02bfefbb157ff5f48 (patch)
treee7aaa6e417b3adff32db14472731ea286b9968e8
parent6d27f67bf6ee2b9ad0c8814118264bc273d916a1 (diff)
[PATCH] Use BIO_RW_SYNC in swap write page
From: Jens Axboe <axboe@suse.de> Dog slow software suspend found this one. If WB_SYNC_ALL, then you need to mark the bio as sync as well. This is because swap_writepage() does a remove_exclusive_swap_page() (going to __delete_from_swap_cache -> __remove_from_page_cache) which can kill page->mapping, thus aops->sync_page() has nothing to work with for unplugging the address space.
-rw-r--r--mm/page_io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/page_io.c b/mm/page_io.c
index dde9d23f99bd..7ec159ded5ca 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -90,7 +90,7 @@ static int end_swap_bio_read(struct bio *bio, unsigned int bytes_done, int err)
int swap_writepage(struct page *page, struct writeback_control *wbc)
{
struct bio *bio;
- int ret = 0;
+ int ret = 0, rw = WRITE;
if (remove_exclusive_swap_page(page)) {
unlock_page(page);
@@ -103,10 +103,12 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
ret = -ENOMEM;
goto out;
}
+ if (wbc->sync_mode == WB_SYNC_ALL)
+ rw |= (1 << BIO_RW_SYNC);
inc_page_state(pswpout);
set_page_writeback(page);
unlock_page(page);
- submit_bio(WRITE, bio);
+ submit_bio(rw, bio);
out:
return ret;
}