Index: linux-2.6.20-rc5/fs/inode.c =================================================================== --- linux-2.6.20-rc5.orig/fs/inode.c 2007-01-18 13:48:35.000000000 -0600 +++ linux-2.6.20-rc5/fs/inode.c 2007-01-19 17:59:34.221078781 -0600 @@ -170,7 +170,7 @@ static struct inode *alloc_inode(struct return inode; } -void destroy_inode(struct inode *inode) +void destroy_inode(struct inode *inode) { BUG_ON(inode_has_buffers(inode)); security_inode_free(inode); @@ -259,6 +259,7 @@ void clear_inode(struct inode *inode) bd_forget(inode); if (S_ISCHR(inode->i_mode) && inode->i_cdev) cd_forget(inode); + cpuset_clear_dirty_nodes(inode->i_mapping); inode->i_state = I_CLEAR; } Index: linux-2.6.20-rc5/kernel/cpuset.c =================================================================== --- linux-2.6.20-rc5.orig/kernel/cpuset.c 2007-01-19 14:14:25.000000000 -0600 +++ linux-2.6.20-rc5/kernel/cpuset.c 2007-01-19 17:34:09.747332093 -0600 @@ -2614,11 +2614,9 @@ void cpuset_update_dirty_nodes(struct ad if (!nodes) { nodes = kmalloc(sizeof(nodemask_t), GFP_ATOMIC); - if (!nodes) { - printk(KERN_INFO "cpuset_update_dirty_nodes: Cannot allocate nodemask for mapping=%p node=%d\n", - mapping, page_to_nid(page)); + printk(KERN_INFO "allocate nodemask for mapping %p = %p\n", mapping, nodes); + if (!nodes) return; - } *nodes = NODE_MASK_NONE; mapping->dirty_nodes = nodes; @@ -2632,10 +2630,10 @@ void cpuset_update_dirty_nodes(struct ad void cpuset_clear_dirty_nodes(struct address_space *mapping) { nodemask_t *nodes = mapping->dirty_nodes; - if (nodes) { mapping->dirty_nodes = NULL; kfree(nodes); + printk(KERN_INFO "release nodemask for mapping %p = %p\n", mapping, nodes); } } @@ -2650,9 +2648,12 @@ int cpuset_intersects_dirty_nodes(struct { nodemask_t *dirty_nodes = mapping->dirty_nodes; - if (!mask || !dirty_nodes) + if (!mask) return 1; + if (!dirty_nodes) + return 0; + return nodes_intersects(*dirty_nodes, *mask); } #endif Index: linux-2.6.20-rc5/mm/page-writeback.c =================================================================== --- linux-2.6.20-rc5.orig/mm/page-writeback.c 2007-01-19 14:15:11.000000000 -0600 +++ linux-2.6.20-rc5/mm/page-writeback.c 2007-01-19 16:22:30.915302730 -0600 @@ -405,7 +405,7 @@ static void background_writeout(unsigned wbc.pages_skipped = 0; writeback_inodes(&wbc); if (wbc.nodes) - printk(KERN_INFO "background_writeout: wrote %d pages.\n", MAX_WRITEBACK_PAGES - + printk(KERN_INFO "background_writeout: wrote %ld pages.\n", MAX_WRITEBACK_PAGES - wbc.nr_to_write); min_pages -= MAX_WRITEBACK_PAGES - wbc.nr_to_write; if (wbc.nr_to_write > 0 || wbc.pages_skipped > 0) { @@ -1004,12 +1004,10 @@ int test_set_page_writeback(struct page radix_tree_tag_set(&mapping->page_tree, page_index(page), PAGECACHE_TAG_WRITEBACK); - if (!PageDirty(page)) { - if (radix_tree_tag_clear(&mapping->page_tree, + if (!PageDirty(page)) + radix_tree_tag_clear(&mapping->page_tree, page_index(page), - PAGECACHE_TAG_DIRTY)) - cpuset_clear_dirty_nodes(mapping); - } + PAGECACHE_TAG_DIRTY); write_unlock_irqrestore(&mapping->tree_lock, flags); } else { ret = TestSetPageWriteback(page);