From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: [PATCH 3/3] writeback: do strict bdi dirty_exceeded Date: Tue, 13 Dec 2011 10:19:13 +0800 Message-ID: <20111213021913.GB14660@localhost> References: <20111213021633.GA14193@localhost> <20111213021740.GA14660@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , Peter Zijlstra , Andrew Morton , Li Shaohua , LKML To: "linux-fsdevel@vger.kernel.org" Return-path: Content-Disposition: inline In-Reply-To: <20111213021740.GA14660@localhost> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 CC: Peter Zijlstra Signed-off-by: Wu Fengguang --- mm/page-writeback.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- linux-next.orig/mm/page-writeback.c 2011-12-04 12:03:06.000000000 +0800 +++ linux-next/mm/page-writeback.c 2011-12-04 12:03:07.000000000 +0800 @@ -1097,7 +1097,7 @@ static void balance_dirty_pages(struct a 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;