Subject: track redirty_tail() calls It helps a lot to know how redirty_tail() are called. Cc: Ken Chen Cc: Andrew Morton Signed-off-by: Fengguang Wu --- fs/fs-writeback.c | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) --- linux.orig/fs/fs-writeback.c 2009-09-19 10:51:47.000000000 +0800 +++ linux/fs/fs-writeback.c 2009-09-19 10:52:03.000000000 +0800 @@ -290,6 +290,21 @@ void bdi_start_writeback(struct backing_ bdi_alloc_queue_work(bdi, &args); } +#define redirty_tail(inode) \ + do { \ + __redirty_tail(inode, __LINE__); \ + } while (0) + +#define requeue_io(inode) \ + do { \ + __requeue_io(inode, __LINE__); \ + } while (0) + +#define requeue_partial_io(wbc, inode) \ + do { \ + __requeue_partial_io(wbc, inode, __LINE__); \ + } while (0) + /* * Redirty an inode: set its when-it-was dirtied timestamp and move it to the * furthest end of its superblock's dirty-inode list. @@ -299,7 +314,7 @@ void bdi_start_writeback(struct backing_ * the case then the inode must have been redirtied while it was being written * out and we don't reset its dirtied_when. */ -static void redirty_tail(struct inode *inode) +static void __redirty_tail(struct inode *inode, int line) { struct bdi_writeback *wb = &inode_to_bdi(inode)->wb; @@ -311,23 +326,33 @@ static void redirty_tail(struct inode *i inode->dirtied_when = jiffies; } list_move(&inode->i_list, &wb->b_dirty); + + if (sysctl_dirty_debug) { + printk(KERN_DEBUG "redirty_tail() +%d: inode=%lu\n", + line, inode->i_ino); + } } /* * requeue inode for re-scanning after bdi->b_io list is exhausted. */ -static void requeue_io(struct inode *inode) +static void __requeue_io(struct inode *inode, int line) { struct bdi_writeback *wb = &inode_to_bdi(inode)->wb; list_move(&inode->i_list, &wb->b_more_io); + + if (sysctl_dirty_debug) { + printk(KERN_DEBUG "requeue_io() +%d: inode=%lu\n", + line, inode->i_ino); + } } /* * continue io on this inode on next writeback if * it has not accumulated large enough writeback io chunk */ -static void requeue_partial_io(struct writeback_control *wbc, struct inode *inode) +static void __requeue_partial_io(struct writeback_control *wbc, struct inode *inode, int line) { if (time_before(wbc->last_file_time + 1000 * HZ, jiffies) || wbc->last_file_written == 0 || @@ -337,6 +362,11 @@ static void requeue_partial_io(struct wr } list_move_tail(&inode->i_list, &inode_to_bdi(inode)->wb.b_io); + + if (sysctl_dirty_debug) { + printk(KERN_DEBUG "requeue_partial_io() +%d: inode=%lu\n", + line, inode->i_ino); + } } static void inode_sync_complete(struct inode *inode)