From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [PATCH 10/10] mm: per device dirty threshold From: Peter Zijlstra In-Reply-To: References: <20070420155154.898600123@chello.nl> <20070420155503.608300342@chello.nl> <17965.29252.950216.971096@notabene.brown> <1177398589.26937.40.camel@twins> <1177403494.26937.59.camel@twins> <1177406817.26937.65.camel@twins> <20070424030021.a091018d.akpm@linux-foundation.org> <1177409538.26937.75.camel@twins> Content-Type: text/plain Date: Tue, 24 Apr 2007 12:24:43 +0200 Message-Id: <1177410283.26937.78.camel@twins> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Miklos Szeredi Cc: akpm@linux-foundation.org, neilb@suse.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, dgc@sgi.com, tomoki.sekiyama.qu@hitachi.com, nikita@clusterfs.com, trond.myklebust@fys.uio.no, yingchao.zhou@gmail.com List-ID: On Tue, 2007-04-24 at 12:19 +0200, Miklos Szeredi wrote: > > > > > Ahh, now I see; I had totally blocked out these few lines: > > > > > > > > > > pages_written += write_chunk - wbc.nr_to_write; > > > > > if (pages_written >= write_chunk) > > > > > break; /* We've done our duty */ > > > > > > > > > > yeah, those look dubious indeed... And reading back Neil's comments, I > > > > > think he agrees. > > > > > > > > > > Shall we just kill those? > > > > > > > > I think we should. > > > > > > > > Athough I'm a little afraid, that Akpm will tell me again, that I'm a > > > > stupid git, and that those lines are in fact vitally important ;) > > > > > > > > > > It depends what they're replaced with. > > > > > > That code is there, iirc, to prevent a process from getting stuck in > > > balance_dirty_pages() forever due to the dirtying activity of other > > > processes. > > > > > > hm, we ask the process to write write_chunk pages each go around the loop. > > > So if it wrote write-chunk/2 pages on the first pass it might end up writing > > > write_chunk*1.5 pages total. I guess that's rare and doesn't matter much > > > if it does happen - the upper bound is write_chunk*2-1, I think. > > > > Right, but I think the problem is that its dirty -> writeback, not dirty > > -> writeback completed. > > > > Ie. they don't guarantee progress, it could be that the total > > nr_reclaimable + nr_writeback will steadily increase due to this break. > > > > How about ensuring that vm_writeout_total increases least > > 2*sync_writeback_pages() during our stay in balance_dirty_pages(). That > > way we have the guarantee that more pages get written out than can be > > dirtied. > > No, because that's a global counter, which many writers could be > looking at. > > We'd need a per-task writeout counter, but when finishing the write we > don't know anymore which task it was performed for. Yeah, just reached that conclusion myself too - again, I ran into that when trying to figure out how to do the per task balancing right. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org