writeback: do strict bdi dirty_exceeded
authorWu Fengguang <fengguang.wu@intel.com>
Sun, 4 Dec 2011 03:26:01 +0000 (21:26 -0600)
committerWu Fengguang <fengguang.wu@intel.com>
Sun, 18 Dec 2011 06:20:31 +0000 (14:20 +0800)
This helps to reduce dirty throttling polls and hence CPU overheads.

bdi->dirty_exceeded typically only helps when suddenly starting 100+
dd's on a disk, in which case the dd's may need to poll
balance_dirty_pages() earlier than tsk->nr_dirtied_pause.

CC: Jan Kara <jack@suse.cz>
CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
mm/page-writeback.c

index 422cf4e..936dc7b 100644 (file)
@@ -1160,7 +1160,7 @@ static void balance_dirty_pages(struct address_space *mapping,
                                    bdi_stat(bdi, BDI_WRITEBACK);
                }
 
-               dirty_exceeded = (bdi_dirty > bdi_thresh) ||
+               dirty_exceeded = (bdi_dirty > bdi_thresh) &&
                                  (nr_dirty > dirty_thresh);
                if (dirty_exceeded && !bdi->dirty_exceeded)
                        bdi->dirty_exceeded = 1;