lkml.org 
[lkml]   [2009]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 29/45] writeback: fix the shmem AOP_WRITEPAGE_ACTIVATE case
When shmem returns AOP_WRITEPAGE_ACTIVATE, the inode pages cannot be
synced in the near future. So write_cache_pages shall stop writting this
inode, and shmem shall increase pages_skipped to instruct VFS not to
busy retry.

CC: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---

---
mm/page-writeback.c | 23 +++++++++++------------
mm/shmem.c | 1 +
2 files changed, 12 insertions(+), 12 deletions(-)

--- linux.orig/mm/page-writeback.c 2009-10-06 23:39:28.000000000 +0800
+++ linux/mm/page-writeback.c 2009-10-06 23:39:29.000000000 +0800
@@ -851,19 +851,18 @@ continue_unlock:
if (ret == AOP_WRITEPAGE_ACTIVATE) {
unlock_page(page);
ret = 0;
- } else {
- /*
- * done_index is set past this page,
- * so media errors will not choke
- * background writeout for the entire
- * file. This has consequences for
- * range_cyclic semantics (ie. it may
- * not be suitable for data integrity
- * writeout).
- */
- done = 1;
- break;
}
+ /*
+ * done_index is set past this page,
+ * so media errors will not choke
+ * background writeout for the entire
+ * file. This has consequences for
+ * range_cyclic semantics (ie. it may
+ * not be suitable for data integrity
+ * writeout).
+ */
+ done = 1;
+ break;
}

if (nr_to_write > 0) {
--- linux.orig/mm/shmem.c 2009-10-06 23:37:40.000000000 +0800
+++ linux/mm/shmem.c 2009-10-06 23:39:29.000000000 +0800
@@ -1103,6 +1103,7 @@ unlock:
*/
swapcache_free(swap, NULL);
redirty:
+ wbc->pages_skipped++;
set_page_dirty(page);
if (wbc->for_reclaim)
return AOP_WRITEPAGE_ACTIVATE; /* Return with page locked */



\
 
 \ /
  Last update: 2009-10-07 10:45    [W:0.209 / U:5.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site