From: Jan Kara Subject: Re: [PATCH 2/3] mm: Fix writeback_in_progress() Date: Tue, 3 Aug 2010 22:55:34 +0200 Message-ID: <20100803205533.GK3322@quack.suse.cz> References: <1280852440-13630-1-git-send-email-jack@suse.cz> <1280852440-13630-3-git-send-email-jack@suse.cz> <20100803163610.GB21273@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , Andrew Morton , Wu Fengguang , linux-fsdevel@vger.kernel.org, Jens Axboe To: Christoph Hellwig Return-path: Received: from cantor2.suse.de ([195.135.220.15]:41639 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756707Ab0HCU4G (ORCPT ); Tue, 3 Aug 2010 16:56:06 -0400 Content-Disposition: inline In-Reply-To: <20100803163610.GB21273@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 03-08-10 12:36:10, Christoph Hellwig wrote: > The patch looks correct to me, but I wonder if we shouldn't try to > get rid of writeback_in_progress instead. There's just two users, Interesting. Yes, it might make sense. > one is the ext4 writeback_if_idle hack, and the other one is > balance_dirty_pages. The latter really should only care about about > other background reclaim beeing pending, and I have no idea why the > former cares - if e.g. any kind of kupdate in the background is pending > which just writes out a few inodes on another fs on the same bdi > it's exiting. The XFS variant of this does unconditional writeback > for all inodes on the sb. You are right that writeback_if_idle probably isn't the right thing ext4 needs. You are also right about the call in balance_dirty_pages but that's harder to solve (as we definitely do not want to file a work item in each balance_dirty_pages call). > Long term I wonder if we shouldn't get rid of the work list entirely, > and just have a few targets for the flusher thread - we just set a > target and wake it up, and it keeps running until all targets are met. I cannot quite see how that would work when several threads want to meet different targets. But I can imagine that background writeback (and kupdate style which I belive should be basically wrapped into the background) wouldn't have a work item in a list but whenever the flusher thread has nothing else to do, it just writes things out until there are no old inodes and we are below dirty_background_ratio. Honza -- Jan Kara SUSE Labs, CR