+ per-backing_dev-dirty-and-writeback-page-accounting-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     mm: Fix dirty page accounting per backing_dev
has been added to the -mm tree.  Its filename is
     per-backing_dev-dirty-and-writeback-page-accounting-fix.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: mm: Fix dirty page accounting per backing_dev
From: Tomoki Sekiyama <tomoki.sekiyama.qu@xxxxxxxxxxx>

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@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/truncate.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN mm/truncate.c~per-backing_dev-dirty-and-writeback-page-accounting-fix mm/truncate.c
--- a/mm/truncate.c~per-backing_dev-dirty-and-writeback-page-accounting-fix
+++ a/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);
_

Patches currently in -mm which might be from tomoki.sekiyama.qu@xxxxxxxxxxx are

per-backing_dev-dirty-and-writeback-page-accounting-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux