From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 1/2] writeback: Improve busyloop prevention Date: Thu, 20 Oct 2011 05:46:49 -0400 Message-ID: <20111020094649.GA11291@infradead.org> References: <1318453043-32057-1-git-send-email-jack@suse.cz> <1318453043-32057-2-git-send-email-jack@suse.cz> <20111013142638.GB6938@localhost> <20111013143939.GA9691@localhost> <20111013201835.GD27363@quack.suse.cz> <20111014160047.GA13330@localhost> <20111014162807.GA4617@localhost> <20111018005128.GI4528@quack.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Wu Fengguang , "linux-fsdevel@vger.kernel.org" , Christoph Hellwig , Dave Chinner To: Jan Kara Return-path: Received: from 173-166-109-252-newengland.hfc.comcastbusiness.net ([173.166.109.252]:43425 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932098Ab1JTJqz (ORCPT ); Thu, 20 Oct 2011 05:46:55 -0400 Content-Disposition: inline In-Reply-To: <20111018005128.GI4528@quack.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Oct 18, 2011 at 02:51:28AM +0200, Jan Kara wrote: > > It's still puzzling why dirty pages remain at 286 and does not get > > cleaned by either flusher threads for local XFS and NFSROOT for so > > long time.. > I was looking at this as well. So the reason why pages were not cleaned > by the flusher thread is that there were 2 dirty inodes and the inode with > dirty pages had i_dirtied_whan newer than the time when we started this > background writeback. Thus the running background writeback work always > included only the other inode which has no dirty pages but I_DIRTY_SYNC set. > Apparently XFS is stubborn and refuses to write the inode although we try > rather hard. That is probably because dd writing to this inode is stuck in > balance_dirty_pages() and holds ilock - which is a bit unfortunate behavior > but what can we do... Stop writing data from balance_dirty_pages()? Anyway, XFS tries very hard to not block in a non-block ->write_inode or ->writepages, which generally is a good thing to avoid getting stuck in the flusher thread. For cases like this where an inode is long beyond it's due time it might make sense to simply do a synchronous write_inode from the flusher thread to force the inode out.