* [patch 04/13] io-accounting: write-cancel accounting
@ 2006-12-08 11:52 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2006-12-08 11:52 UTC (permalink / raw)
To: linux-kernel
Cc: akpm, balbir, csturtiv, daw, guillaume.thouvenin, jlan, nagar, tee
From: Andrew Morton <akpm@osdl.org>
Account for the number of byte writes which this process caused to not happen
after all.
Cc: Jay Lan <jlan@sgi.com>
Cc: Shailabh Nagar <nagar@watson.ibm.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Chris Sturtivant <csturtiv@sgi.com>
Cc: Tony Ernst <tee@sgi.com>
Cc: Guillaume Thouvenin <guillaume.thouvenin@bull.net>
Cc: David Wright <daw@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
fs/buffer.c | 7 ++++++-
mm/truncate.c | 4 +++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff -puN fs/buffer.c~io-accounting-write-cancel-accounting fs/buffer.c
--- a/fs/buffer.c~io-accounting-write-cancel-accounting
+++ a/fs/buffer.c
@@ -2823,8 +2823,13 @@ int try_to_free_buffers(struct page *pag
* could encounter a non-uptodate page, which is unresolvable.
* This only applies in the rare case where try_to_free_buffers
* succeeds but the page is not freed.
+ *
+ * Also, during truncate, discard_buffer will have marked all
+ * the page's buffers clean. We discover that here and clean
+ * the page also.
*/
- clear_page_dirty(page);
+ if (test_clear_page_dirty(page))
+ task_io_account_cancelled_write(PAGE_CACHE_SIZE);
}
out:
if (buffers_to_free) {
diff -puN mm/truncate.c~io-accounting-write-cancel-accounting mm/truncate.c
--- a/mm/truncate.c~io-accounting-write-cancel-accounting
+++ a/mm/truncate.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/pagemap.h>
#include <linux/pagevec.h>
+#include <linux/task_io_accounting_ops.h>
#include <linux/buffer_head.h> /* grr. try_to_release_page,
do_invalidatepage */
@@ -69,7 +70,8 @@ truncate_complete_page(struct address_sp
if (PagePrivate(page))
do_invalidatepage(page, 0);
- clear_page_dirty(page);
+ if (test_clear_page_dirty(page))
+ task_io_account_cancelled_write(PAGE_CACHE_SIZE);
ClearPageUptodate(page);
ClearPageMappedToDisk(page);
remove_from_page_cache(page);
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-12-08 11:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-08 11:52 [patch 04/13] io-accounting: write-cancel accounting akpm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®