From: Mel Gorman Subject: Re: [PATCH 03/10] writeback: Do not congestion sleep if there are no congested BDIs or significant writeback Date: Mon, 13 Sep 2010 11:30:12 +0100 Message-ID: <20100913103012.GG23508@csn.ul.ie> References: <1283770053-18833-4-git-send-email-mel@csn.ul.ie> <20100907152533.GB4620@barrios-desktop> <20100908110403.GB29263@csn.ul.ie> <20100908145245.GG4620@barrios-desktop> <20100909085436.GJ29263@csn.ul.ie> <20100912153744.GA3563@barrios-desktop> <20100913085549.GA23508@csn.ul.ie> <20100913100759.GE23508@csn.ul.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Linux Kernel List , Rik van Riel , Johannes Weiner , Wu Fengguang , Andrea Arcangeli , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Dave Chinner , Chris Mason , Christoph Hellwig , Andrew Morton To: Minchan Kim Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Mon, Sep 13, 2010 at 07:20:37PM +0900, Minchan Kim wrote: > On Mon, Sep 13, 2010 at 7:07 PM, Mel Gorman wrote: > > On Mon, Sep 13, 2010 at 06:48:10PM +0900, Minchan Kim wrote: > >> >> > > > > >> >> > > > I'm not saying it is. The objective is to identify a situ= ation where > >> >> > > > sleeping until the next write or congestion clears is poi= ntless. We have > >> >> > > > already identified that we are not congested so the quest= ion is "are we > >> >> > > > writing a lot at the moment?". The assumption is that if = there is a lot > >> >> > > > of writing going on, we might as well sleep until one com= pletes rather > >> >> > > > than reclaiming more. > >> >> > > > > >> >> > > > This is the first effort at identifying pointless sleeps.= Better ones > >> >> > > > might be identified in the future but that shouldn't stop= us making a > >> >> > > > semi-sensible decision now. > >> >> > > > >> >> > > nr_bdi_congested is no problem since we have used it for a = long time. > >> >> > > But you added new rule about writeback. > >> >> > > > >> >> > > >> >> > Yes, I'm trying to add a new rule about throttling in the pag= e allocator > >> >> > and from vmscan. As you can see from the results in the leade= r, we are > >> >> > currently sleeping more than we need to. > >> >> > >> >> I can see the about avoiding congestion_wait but can't find abo= ut > >> >> (writeback < incative / 2) hueristic result. > >> >> > >> > > >> > See the leader and each of the report sections entitled > >> > "FTrace Reclaim Statistics: congestion_wait". It provides a meas= ure of > >> > how sleep times are affected. > >> > > >> > "congest waited" are waits due to calling congestion_wait. "cond= itional waited" > >> > are those related to wait_iff_congested(). As you will see from = the reports, > >> > sleep times are reduced overall while callers of wait_iff_conges= ted() still > >> > go to sleep. The reports entitled "FTrace Reclaim Statistics: vm= scan" show > >> > how reclaim is behaving and indicators so far are that reclaim i= s not hurt > >> > by introducing wait_iff_congested(). > >> > >> I saw =A0the result. > >> It was a result about effectiveness _both_ nr_bdi_congested and > >> (writeback < inactive/2). > >> What I mean is just effectiveness (writeback < inactive/2) _alone_= =2E > > > > I didn't measured it because such a change means that wait_iff_cong= ested() > > ignored BDI congestion. If we were reclaiming on a NUMA machine for= example, > > it could mean that a BDI gets flooded with requests if we only chec= ked the > > ratios of one zone if little writeback was happening in that zone a= t the > > time. It did not seem like a good idea to ignore congestion. >=20 > You seem to misunderstand my word. > Sorry for not clear sentence. >=20 > I don't mean ignore congestion. > First of all, we should consider congestion of bdi. > My meant is whether we need adding up (nr_writeback < nr_inacive /2) > heuristic plus congestion bdi. Early tests indicated "yes". > It wasn't previous version in your patch but it showed up in this ver= sion. > So I thought apparently you have any evidence why we should add such = heuristic. >=20 Only the feedback from the first patch where Johannes posted a workload= that did exhibit a problem. Isolated tests on just that workload led to the=20 (nr_writeback < inactive / 2) change. > > > >> If we remove (writeback < inactive / 2) check and unconditionally > >> return, how does the behavior changed? > >> > > > > Based on just the workload Johannes sent, scanning and completion t= imes both > > increased without any improvement in the scanning/reclaim ratio (a = bad result) > > hence why this logic was introduced to back off where there is some > > writeback taking place even if the BDI is not congested. >=20 > Yes. That's what I want. At least, comment of function should have it > to understand the logic. In addition, It would be better to add the > number to show how it back off well. >=20 Very well. I'll hold off posting v2 of the series now then because prod= ucing such results take many hours and my machines are currently busy. Hopefully I'll have something by Wednesday. --=20 Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab