Debug patch Add some debug printk's to watch how the cpuset specific throttling code is doing. Signed-off-by: Christoph Lameter Index: linux-2.6.20-rc4-mm1/fs/fs-writeback.c =================================================================== --- linux-2.6.20-rc4-mm1.orig/fs/fs-writeback.c 2007-01-12 13:01:25.000000000 -0800 +++ linux-2.6.20-rc4-mm1/fs/fs-writeback.c 2007-01-12 13:01:29.000000000 -0800 @@ -361,6 +361,8 @@ nodes_addr(*wbc->nodes), nr_node_ids)) { /* No pages on nodes that we are flushing now */ list_move(&inode->i_list, &sb->s_dirty); + printk(KERN_INFO "sync_sb_inodes %p dirty_map=%lx allowed=%lx\n", + inode, inode->dirty_nodes.bits[0], wbc->nodes->bits[0]); continue; } #endif Index: linux-2.6.20-rc4-mm1/mm/page-writeback.c =================================================================== --- linux-2.6.20-rc4-mm1.orig/mm/page-writeback.c 2007-01-12 13:01:22.000000000 -0800 +++ linux-2.6.20-rc4-mm1/mm/page-writeback.c 2007-01-12 13:01:29.000000000 -0800 @@ -274,6 +274,9 @@ if (nr_reclaimable + dl.nr_writeback <= dl.thresh_dirty) break; pages_written += write_chunk - wbc.nr_to_write; + if (pages_written) + printk(KERN_INFO "Synchrononous writeback nodes=%lx wrote %ld pages triggered by inode %p\n", + cpuset_current_mems_allowed.bits[0], pages_written, mapping->host); if (pages_written >= write_chunk) break; /* We've done our duty */ } @@ -296,9 +299,12 @@ * background_thresh, to keep the amount of dirty memory low. */ if ((laptop_mode && pages_written) || - (!laptop_mode && (nr_reclaimable > dl.thresh_background))) + (!laptop_mode && (nr_reclaimable > dl.thresh_background))) { + printk(KERN_INFO "Background writeback nodes=%lx triggered by inode %p\n", + cpuset_current_mems_allowed.bits[0], mapping->host); pdflush_operation(background_writeout, 0, &cpuset_current_mems_allowed); + } } void set_page_dirty_balance(struct page *page) @@ -418,10 +424,15 @@ */ int wakeup_pdflush(long nr_pages, nodemask_t *nodes) { + int rc; + if (nr_pages == 0) nr_pages = global_page_state(NR_FILE_DIRTY) + global_page_state(NR_UNSTABLE_NFS); - return pdflush_operation(background_writeout, nr_pages, nodes); + rc = pdflush_operation(background_writeout, nr_pages, nodes); + printk(KERN_INFO "wakeup_pdflush(%ld,%lx) == %d\n",nr_pages, nodes ? nodes->bits[0]: 0, + rc); + return rc; } static void wb_timer_fn(unsigned long unused); @@ -832,6 +843,9 @@ if (mapping->host) { /* !PageAnon && !swapper_space */ __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + if (!node_isset(page_to_nid(page), mapping->host->dirty_nodes)) +printk(KERN_INFO "__set_page_dirty_nobuffers: Dirty map update inode=%p node=%d\n", mapping->host, page_to_nid(page)); + cpuset_update_dirty_nodes(mapping->host, page); } return 1; Index: linux-2.6.20-rc4-mm1/fs/buffer.c =================================================================== --- linux-2.6.20-rc4-mm1.orig/fs/buffer.c 2007-01-12 12:59:59.000000000 -0800 +++ linux-2.6.20-rc4-mm1/fs/buffer.c 2007-01-12 13:01:29.000000000 -0800 @@ -741,6 +741,10 @@ } write_unlock_irq(&mapping->tree_lock); __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); + if (!node_isset(page_to_nid(page), mapping->host->dirty_nodes)) + printk(KERN_INFO "__set_page_dirty_buffers: Dirty map update inode=%p node=%d\n", + mapping->host, page_to_nid(page)); + cpuset_update_dirty_nodes(mapping->host, page); return 1; }