Subject: writeback: global writeback throughput Date: Sat Apr 16 18:25:51 CST 2011 Signed-off-by: Wu Fengguang --- mm/page-writeback.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- linux-next.orig/mm/page-writeback.c 2011-04-16 18:26:54.000000000 +0800 +++ linux-next/mm/page-writeback.c 2011-04-16 20:13:21.000000000 +0800 @@ -994,6 +994,7 @@ void bdi_update_bandwidth(struct backing unsigned long elapsed; unsigned long dirtied; unsigned long written; + struct backing_dev_info *gbdi = &default_backing_dev_info; if (!spin_trylock(&dirty_lock)) return; @@ -1016,11 +1017,15 @@ void bdi_update_bandwidth(struct backing if (elapsed <= MAX_PAUSE) goto unlock; - if (thresh && - now - default_backing_dev_info.bw_time_stamp >= MAX_PAUSE) { + if (thresh && now - gbdi->bw_time_stamp >= MAX_PAUSE) { update_dirty_limit(thresh, dirty); - bdi_update_dirty_smooth(&default_backing_dev_info, dirty); - default_backing_dev_info.bw_time_stamp = now; + bdi_update_dirty_smooth(gbdi, dirty); + if (now - gbdi->bw_time_stamp < HZ + MAX_PAUSE) + __bdi_update_write_bandwidth(gbdi, + now - gbdi->bw_time_stamp, + global_page_state(NR_WRITTEN)); + gbdi->bw_time_stamp = now; + gbdi->written_stamp = global_page_state(NR_WRITTEN); } if (thresh) { bdi_update_dirty_ratelimit(bdi, thresh, dirty,