[<prev] [next>] [day] [month] [year] [list]
Message-ID: <45C9A43F.2010401@hitachi.com>
Date: Wed, 07 Feb 2007 19:04:47 +0900
From: Tomoki Sekiyama <tomoki.sekiyama.qu@...achi.com>
To: linux-kernel@...r.kernel.org, akpm@...ux-foundation.org
Cc: yumiko.sugita.yf@...achi.com, masami.hiramatsu.pt@...achi.com,
yuji.kakutani.uw@...achi.com, hidehiro.kawai.ez@...achi.com,
satoshi.oshima.fk@...achi.com
Subject: [BUG][PATCH] mm: Fix dirty page accounting per backing_dev
Hello Andrew,
I found a suspicious bug of I/O accounting in 2.6.20-rc6-mm3.
The number of dirty pages per backing_dev available from
/sys/block/<dev>/queue/nr_dirty keeps growing when a file is
rapidly overwritten several times.
For example:
% cat /sys/block/sda/queue/nr_dirty
104
% for i in 1 2; do dd if=/dev/zero of=dummy bs=4096 count=1; done; sync
% cat /sys/block/sda/queue/nr_dirty
105
% for i in 1 2 3; do dd if=/dev/zero of=dummy bs=4096 count=1; done; sync
% cat /sys/block/sda/queue/nr_dirty
107
This patch fixes it.
Signed-off-by: Tomoki Sekiyama <tomoki.sekiyama.qu@...achi.com>
---
mm/truncate.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-2.6.20-rc6-mm3/mm/truncate.c
===================================================================
--- linux-2.6.20-rc6-mm3.orig/mm/truncate.c
+++ linux-2.6.20-rc6-mm3/mm/truncate.c
@@ -70,6 +70,7 @@ void cancel_dirty_page(struct page *page
if (TestClearPageDirty(page)) {
struct address_space *mapping = page->mapping;
if (mapping && mapping_cap_account_dirty(mapping)) {
+ atomic_long_dec(&mapping->backing_dev_info->nr_dirty);
dec_zone_page_state(page, NR_FILE_DIRTY);
if (account_size)
task_io_account_cancelled_write(account_size);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists