From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: Re: [PATCH 02/35] writeback: safety margin for bdi stat error Date: Thu, 13 Jan 2011 18:41:54 +0800 Message-ID: <20110113104154.GA5309@localhost> References: <20101213144646.341970461@intel.com> <20101213150326.604451840@intel.com> <20110112215949.GD14260@quack.suse.cz> <20110113041440.GC7840@localhost> <20110113103834.GA5008@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Peter Zijlstra , Christoph Hellwig , Trond Myklebust , Dave Chinner , Theodore Ts'o , Chris Mason , Mel Gorman , Rik van Riel , KOSAKI Motohiro , Greg Thelen , Minchan Kim , linux-mm , "linux-fsdevel@vger.kernel.org" , LKML To: Jan Kara Return-path: Received: from mga02.intel.com ([134.134.136.20]:13147 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932421Ab1AMKl6 (ORCPT ); Thu, 13 Jan 2011 05:41:58 -0500 Content-Disposition: inline In-Reply-To: <20110113103834.GA5008@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Jan 13, 2011 at 06:38:34PM +0800, Jan Kara wrote: > On Thu 13-01-11 12:14:40, Wu Fengguang wrote: > > On Thu, Jan 13, 2011 at 05:59:49AM +0800, Jan Kara wrote: > > > > So the root cause is, the bdi_dirty is well under the global nr_dirty > > > > due to accounting errors. This can be fixed by using bdi_stat_sum(), > > > So which statistic had the big error? I'd just like to understand > > > this (and how come your patch improves the situation)... > > > > bdi_stat_error() = nr_cpu_ids * BDI_STAT_BATCH > > = 8 * (8*(1+ilog2(8))) > > = 8 * 8 * 4 > > = 256 pages > > = 1MB > Yes, my question was more aiming at on which statistics the error happens > so that it causes problems for you. Thinking about it now I suppose you > observe that bdi_nr_writeback + bdi_nr_reclaimable < bdi_thresh but in fact > the number of pages is higher than bdi_thresh because of accounting errors. > And thus we are able to reach global dirty limit and the tasks get > throttled heavily. Am I right? Yes, exactly. Thanks, Fengguang