Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758285Ab0LNO5G (ORCPT ); Tue, 14 Dec 2010 09:57:06 -0500 Received: from mga03.intel.com ([143.182.124.21]:59490 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757937Ab0LNO5A (ORCPT ); Tue, 14 Dec 2010 09:57:00 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.59,342,1288594800"; d="scan'208";a="361487810" Date: Tue, 14 Dec 2010 22:56:54 +0800 From: Wu Fengguang To: Richard Kennedy Cc: Andrew Morton , Jan Kara , 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 Subject: Re: [PATCH 04/35] writeback: reduce per-bdi dirty threshold ramp up time Message-ID: <20101214145654.GA25607@localhost> References: <20101213144646.341970461@intel.com> <20101213150326.856922289@intel.com> <1292333854.2019.16.camel@castor.rsk> <20101214135910.GA21401@localhost> <20101214143325.GA22764@localhost> <20101214143902.GA24827@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101214143902.GA24827@localhost> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2975 Lines: 65 On Tue, Dec 14, 2010 at 10:39:02PM +0800, Wu Fengguang wrote: > On Tue, Dec 14, 2010 at 10:33:25PM +0800, Wu Fengguang wrote: > > On Tue, Dec 14, 2010 at 09:59:10PM +0800, Wu Fengguang wrote: > > > On Tue, Dec 14, 2010 at 09:37:34PM +0800, Richard Kennedy wrote: > > > > > > As to the ramp up time, when writing to 2 disks at the same time I see > > > > the per_bdi_threshold taking up to 20 seconds to converge on a steady > > > > value after one of the write stops. So I think this could be speeded up > > > > even more, at least on my setup. > > > > > > I have the roughly same ramp up time on the 1-disk 3GB mem test: > > > > > > http://www.kernel.org/pub/linux/kernel/people/wfg/writeback/tests/3G/ext4-1dd-1M-8p-2952M-2.6.37-rc5+-2010-12-09-00-37/dirty-pages.png > > > > > > > Interestingly, the above graph shows that after about 10s fast ramp > > up, there is another 20s slow ramp down. It's obviously due the > > decline of global limit: > > > > http://www.kernel.org/pub/linux/kernel/people/wfg/writeback/tests/3G/ext4-1dd-1M-8p-2952M-2.6.37-rc5+-2010-12-09-00-37/vmstat-dirty.png > > > > But why is the global limit declining? The following log shows that > > nr_file_pages keeps growing and goes stable after 75 seconds (so long > > time!). In the same period nr_free_pages goes slowly down to its > > stable value. Given that the global limit is mainly derived from > > nr_free_pages+nr_file_pages (I disabled swap), something must be > > slowly eating memory until 75 ms. Maybe the tracing ring buffers? > > > > free file reclaimable pages > > 50s 369324 + 318760 => 688084 > > 60s 235989 + 448096 => 684085 > > > > http://www.kernel.org/pub/linux/kernel/people/wfg/writeback/tests/3G/ext4-1dd-1M-8p-2952M-2.6.37-rc5+-2010-12-09-00-37/vmstat > > The log shows that ~64MB reclaimable memory is stoled. But the trace > data only takes 1.8MB. Hmm.. ext2 has the same pattern: http://www.kernel.org/pub/linux/kernel/people/wfg/writeback/tests/3G/ext2-1dd-1M-8p-2952M-2.6.37-rc5+-2010-12-09-01-36/dirty-pages.png But it does not happen for btrfs! http://www.kernel.org/pub/linux/kernel/people/wfg/writeback/tests/3G/btrfs-1dd-1M-8p-2952M-2.6.37-rc5-2010-12-10-21-23/vmstat-dirty.png Seems that it's the nr_slab_reclaimable keep growing until 75s. Looking at http://www.kernel.org/pub/linux/kernel/people/wfg/writeback/tests/3G/ext2-1dd-1M-8p-2952M-2.6.37-rc5+-2010-12-09-01-36/slabinfo-end It should be the buffer heads that slowly eats the memory during the time: buffer_head 670304 670662 104 37 1 : tunables 120 60 8 : slabdata 18117 18126 480 (670304/37)*4 = 72464KB. The consumption seems acceptable for a 3G memory system. Thanks, Fengguang -- 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/