Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755059Ab2ECDxZ (ORCPT ); Wed, 2 May 2012 23:53:25 -0400 Received: from mga01.intel.com ([192.55.52.88]:10235 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754004Ab2ECDxX (ORCPT ); Wed, 2 May 2012 23:53:23 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.71,315,1320652800"; d="scan'208";a="148759364" Date: Thu, 3 May 2012 11:53:13 +0800 From: Fengguang Wu To: Jan Kara Cc: Chris Mason , Andrew Morton , Jeff Moyer , Jens Axboe , linux-fsdevel@vger.kernel.org, LKML , Dave Chinner , Christoph Hellwig , Shaohua Li Subject: [PATCH] writeback: initialize global_dirty_limit Message-ID: <20120503035313.GA14606@localhost> References: <20120408010600.GA31377@localhost> <20120411161344.309f12ef.akpm@linux-foundation.org> <20120412013224.GA5859@localhost> <20120412022040.GA6800@localhost> <20120412142634.GA16559@quack.suse.cz> <20120413014026.GA9027@localhost> <20120503034311.GA14081@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120503034311.GA14081@localhost> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1141 Lines: 27 This prevents global_dirty_limit from remaining 0 (the initial value) for long time, since it's only updated in update_dirty_limit() when above the dirty freerun area. It will avoid unexpected consequences when some random code use it as a convenient approximation of the global dirty threshold. Signed-off-by: Fengguang Wu --- mm/page-writeback.c | 1 + 1 file changed, 1 insertion(+) --- linux-next.orig/mm/page-writeback.c 2012-04-25 20:16:12.766859391 +0800 +++ linux-next/mm/page-writeback.c 2012-05-03 11:44:32.746272930 +0800 @@ -1568,6 +1568,7 @@ void writeback_set_ratelimit(void) unsigned long background_thresh; unsigned long dirty_thresh; global_dirty_limits(&background_thresh, &dirty_thresh); + global_dirty_limit = dirty_thresh; ratelimit_pages = dirty_thresh / (num_online_cpus() * 32); if (ratelimit_pages < 16) ratelimit_pages = 16; -- 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/