Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932290AbWHNXkT (ORCPT ); Mon, 14 Aug 2006 19:40:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932465AbWHNXkT (ORCPT ); Mon, 14 Aug 2006 19:40:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:48101 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S932290AbWHNXkR (ORCPT ); Mon, 14 Aug 2006 19:40:17 -0400 From: Neil Brown To: linux-kernel@vger.kernel.org Date: Tue, 15 Aug 2006 09:40:12 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17633.2524.95912.960672@cse.unsw.edu.au> Subject: RFC - how to balance Dirty+Writeback in the face of slow writeback. X-Mailer: VM 7.19 under Emacs 21.4.1 X-face: [Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9D Writeback - flush and wait if Dirty < Writeback - just wait bdflush should get some writeback underway before we hit the 40%, so balance_dirty_pages shouldn't find itself waiting for the pages it just flushed. Suggestions? Opinions? The following patch demonstrates the last suggestion. Thanks, NeilBrown Signed-off-by: Neil Brown ### Diffstat output ./mm/page-writeback.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff .prev/mm/page-writeback.c ./mm/page-writeback.c --- .prev/mm/page-writeback.c 2006-08-15 09:36:23.000000000 +1000 +++ ./mm/page-writeback.c 2006-08-15 09:39:17.000000000 +1000 @@ -207,7 +207,7 @@ static void balance_dirty_pages(struct a * written to the server's write cache, but has not yet * been flushed to permanent storage. */ - if (nr_reclaimable) { + if (nr_reclaimable > global_page_state(NR_WRITEBACK)) { writeback_inodes(&wbc); get_dirty_limits(&background_thresh, &dirty_thresh, mapping); @@ -218,8 +218,6 @@ static void balance_dirty_pages(struct a <= dirty_thresh) break; pages_written += write_chunk - wbc.nr_to_write; - if (pages_written >= write_chunk) - break; /* We've done our duty */ } blk_congestion_wait(WRITE, HZ/10); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/