From: Jan Kara Subject: Re: [PATCH 3/3 v2] mm: Avoid resetting wb_start after each writeback round Date: Sun, 8 Aug 2010 00:45:57 +0200 Message-ID: <20100807224557.GB3573@quack.suse.cz> References: <1281034399-13055-1-git-send-email-jack@suse.cz> <1281034399-13055-4-git-send-email-jack@suse.cz> <20100805172107.703ccf77.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , linux-fsdevel@vger.kernel.org, hch@infradead.org, jaxboe@fusionio.com, Wu Fengguang To: Andrew Morton Return-path: Received: from cantor2.suse.de ([195.135.220.15]:41126 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752271Ab0HGWqe (ORCPT ); Sat, 7 Aug 2010 18:46:34 -0400 Content-Disposition: inline In-Reply-To: <20100805172107.703ccf77.akpm@linux-foundation.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu 05-08-10 17:21:07, Andrew Morton wrote: > On Thu, 5 Aug 2010 20:53:19 +0200 > Jan Kara wrote: > > > WB_SYNC_NONE writeback is done in rounds of 1024 pages so that we don't write > > out some huge inode for too long while starving writeout of other inodes. To > > avoid livelocks, we record time we started writeback in wbc->wb_start and do > > not write out inodes which were dirtied after this time. But currently, > > writeback_inodes_wb() resets wb_start each time it is called thus effectively > > invalidating this logic and making any WB_SYNC_NONE writeback prone to > > livelocks. > > data point: that was eight-year-old code that we broke. Five months ago. > > How did you discover this? You have test cases which cover this > scenario and things locked up? There was a bug report where someone complained sync(1) takes much longer than it used to. So I had look at the code and noticed this bug (and also the problem that we get stuck doing background writeback while the sync work is waiting). Honza -- Jan Kara SUSE Labs, CR