Thread (74 messages) 74 messages, 9 authors, 2011-11-12
STALE5338d

[PATCH 18/18] btrfs: fix dirtied pages accounting on sub-page writes

From: Wu Fengguang <hidden>
Date: 2011-09-04 01:53:23
Also in: linux-fsdevel, lkml

When doing 1KB sequential writes to the same page,
balance_dirty_pages_ratelimited_nr() should be called once instead of 4
times, the latter makes the dirtier tasks be throttled much too heavy.

Fix it with proper de-accounting on clear_page_dirty_for_io().

CC: Chris Mason <redacted>
Signed-off-by: Wu Fengguang <redacted>
---
 fs/btrfs/file.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--- linux-next.orig/fs/btrfs/file.c	2011-08-29 19:14:32.000000000 +0800
+++ linux-next/fs/btrfs/file.c	2011-08-29 19:14:40.000000000 +0800
@@ -1138,7 +1138,8 @@ again:
 				     GFP_NOFS);
 	}
 	for (i = 0; i < num_pages; i++) {
-		clear_page_dirty_for_io(pages[i]);
+		if (clear_page_dirty_for_io(pages[i]))
+			account_page_redirty(pages[i]);
 		set_page_extent_mapped(pages[i]);
 		WARN_ON(!PageLocked(pages[i]));
 	}


--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help