Re: 2.6.22-rc1-mm1

From: Nick Piggin
Date: Wed May 16 2007 - 10:37:32 EST


Michal Piotrowski wrote:
Andrew Morton napisaÅ(a):

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.22-rc1/2.6.22-rc1-mm1/


- I found some time to look into some writeback problems in
fs/fs-writeback.c.


This might be related

[ 97.740021] BUG: at /home/devel/linux-mm/mm/page-writeback.c:829 __set_page_dirty_nobuffers()
[ 97.748632] [<c0105276>] dump_trace+0x63/0x1eb
[ 97.753275] [<c0105418>] show_trace_log_lvl+0x1a/0x30
[ 97.758521] [<c010605a>] show_trace+0x12/0x14
[ 97.763042] [<c01060f7>] dump_stack+0x16/0x18
[ 97.767590] [<c01677b3>] __set_page_dirty_nobuffers+0xfe/0x16e
[ 97.773598] [<c0167833>] redirty_page_for_writepage+0x10/0x12
[ 97.779491] [<c01a473a>] __block_write_full_page+0x1dc/0x335
[ 97.785328] [<c01a495c>] block_write_full_page+0xc9/0xd1
[ 97.790799] [<c01a781a>] blkdev_writepage+0x12/0x14
[ 97.795829] [<c01674ea>] __writepage+0xe/0x29
[ 97.800350] [<c01679b8>] write_cache_pages+0x183/0x29a
[ 97.805683] [<c0167af1>] generic_writepages+0x22/0x2a
[ 97.810929] [<c0167b1c>] do_writepages+0x23/0x34
[ 97.815702] [<c019f0a3>] __writeback_single_inode+0x245/0x472
[ 97.821632] [<c019f7e6>] generic_sync_sb_inodes+0x347/0x4cc
[ 97.827379] [<c019f98b>] sync_sb_inodes+0x20/0x24
[ 97.832247] [<c019fb93>] writeback_inodes+0x79/0xc2
[ 97.837296] [<c0168173>] wb_kupdate+0x7a/0xdb
[ 97.841833] [<c01686a0>] pdflush+0xf1/0x189
[ 97.846173] [<c0137d41>] kthread+0x3b/0x62
[ 97.850461] [<c0104e3f>] kernel_thread_helper+0x7/0x10

No, that's a debugging patch I put in that missed a couple of corner cases
(oops, you live and learn!).

Actually I worked out what this one is too: just a case of a page with
buffers (so the page itself may be dirty && !uptodate), which is calling
__set_page_dirty_nobuffers via redirty_page_for_writepages.

The patch I sent out earlier to fix Jiri's NFS warnings should take care
of this one as well.

--
SUSE Labs, Novell Inc.
Index: linux-2.6/mm/page-writeback.c
===================================================================
--- linux-2.6.orig/mm/page-writeback.c
+++ linux-2.6/mm/page-writeback.c
@@ -826,7 +826,7 @@ int __set_page_dirty_nobuffers(struct pa
mapping2 = page_mapping(page);
if (mapping2) { /* Race with truncate? */
BUG_ON(mapping2 != mapping);
- WARN_ON(!PageUptodate(page));
+ WARN_ON(!PagePrivate(page) && !PageUptodate(page));
if (mapping_cap_account_dirty(mapping)) {
__inc_zone_page_state(page, NR_FILE_DIRTY);
task_io_account_write(PAGE_CACHE_SIZE);