Re: [PATCH 4/5] writeback: remove pages_skipped accounting in __block_write_full_page()

Previous thread: Re: [PATCH 5/5] writeback: introduce writeback_control.more_io to indicate more io by David Chinner on Tuesday, October 2, 2007 - 5:47 pm. (2 messages)

Next thread: PROBLEM: high load average when idle by Anders on Tuesday, October 2, 2007 - 5:37 pm. (20 messages)
To: Fengguang Wu <wfg@...>
Cc: Andrew Morton <akpm@...>, <linux-kernel@...>, David Chinner <dgc@...>, Ken Chen <kenchen@...>, Andrew Morton <akpm@...>, Michael Rubin <mrubin@...>
Date: Tuesday, October 2, 2007 - 5:55 pm

Ok, so that means we need an equivalent fix in xfs_start_page_writeback()
as it will skip pages with clean buffers just like this. Something like
this (untested)?

---
fs/xfs/linux-2.6/xfs_aops.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_aops.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_aops.c 2007-10-02 16:12:56.000000000 +1000
+++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_aops.c 2007-10-03 07:53:27.866602431 +1000
@@ -420,10 +420,9 @@ xfs_start_page_writeback(
clear_page_dirty_for_io(page);
set_page_writeback(page);
unlock_page(page);
- if (!buffers) {
+ /* If no buffers on the page are to be written, finish it here */
+ if (!buffers)
end_page_writeback(page);
- wbc->pages_skipped++; /* We didn't write this page */
- }
}

static inline int bio_add_buffer(struct bio *bio, struct buffer_head *bh)

--
Dave Chinner
Principal Engineer
SGI Australian Software Group

-

To: David Chinner <dgc@...>
Cc: Andrew Morton <akpm@...>, <linux-kernel@...>, Ken Chen <kenchen@...>, Andrew Morton <akpm@...>, Michael Rubin <mrubin@...>
Date: Tuesday, October 2, 2007 - 9:43 pm

Sure OK - as long as it is 'no write because of clean buffer'.
The only user of pages_skipped is obviously using that semantics.

Andrew, here is the expanded patch:
---
writeback: remove pages_skipped accounting in __block_write_full_page()

It can be produced by the following test scheme:

# cat bin/test-writeback.sh
grep nr_dirty /proc/vmstat
echo 1 > /proc/sys/fs/inode_debug
dd if=/dev/zero of=/var/x bs=1K count=204800&
while true; do grep nr_dirty /proc/vmstat; sleep 1; done

# bin/test-writeback.sh
nr_dirty 19207
nr_dirty 19207
nr_dirty 30924
204800+0 records in
204800+0 records out
209715200 bytes (210 MB) copied, 1.58363 seconds, 132 MB/s
nr_dirty 47150
nr_dirty 47141
nr_dirty 47142
nr_dirty 47142
nr_dirty 47142
nr_dirty 47142
nr_dirty 47205
nr_dirty 47214
nr_dirty 47214
nr_dirty 47214
nr_dirty 47214
nr_dirty 47214
nr_dirty 47215
nr_dirty 47216
nr_dirty 47216
nr_dirty 47216
nr_dirty 47154
nr_dirty 47143
nr_dirty 47143
nr_dirty 47143
nr_dirty 47143
nr_dirty 47143
nr_dirty 47142
nr_dirty 47142
nr_dirty 47142
nr_dirty 47142
nr_dirty 47134
nr_dirty 47134
nr_dirty 47135
nr_dirty 47135
nr_dirty 47135
nr_dirty 46097 <== -1038
nr_dirty 46098
nr_dirty 46098
nr_dirty 46098
[...]
nr_dirty 46091
nr_dirty 46092
nr_dirty 46092
nr_dirty 45069 <== -1023
nr_dirty 45056
nr_dirty 45056
nr_dirty 45056
[...]
nr_dirty 37822
nr_dirty 36799 <== -1023
[...]
nr_dirty 36781
nr_dirty 35758 <== -1023
[...]
nr_dirty 34708
nr_dirty 33672 <== -1024
[...]
nr_dirty 33692
nr_dirty 32669 <== -1023

% ls -li /var/x
847824 -rw-r--r-- 1 root root 200M 2007-08-12 04:12 /var/x

% dmesg|grep 847824 # generated by a debug printk
[ 529.263184] redirtied inode 847824 line 548
[ 564.250872] redirtied inode 847824 line 548
[ 594.272797] redirtied inode 847824 line 548
[ 629.231330] redirtied inode 847824 line 548
[ 659.224674] redirtied inode 847824 line 548
[ 689.219890] redirtied inode 847824 line 548
[ 724.226655] redirtie...

Previous thread: Re: [PATCH 5/5] writeback: introduce writeback_control.more_io to indicate more io by David Chinner on Tuesday, October 2, 2007 - 5:47 pm. (2 messages)

Next thread: PROBLEM: high load average when idle by Anders on Tuesday, October 2, 2007 - 5:37 pm. (20 messages)