From: Jan Kara Subject: Re: [PATCH 1/3] mm: Stop background writeback if there is other work queued for the thread Date: Tue, 3 Aug 2010 22:41:45 +0200 Message-ID: <20100803204145.GJ3322@quack.suse.cz> References: <1280852440-13630-1-git-send-email-jack@suse.cz> <1280852440-13630-2-git-send-email-jack@suse.cz> <20100803163321.GA21273@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]:41036 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754466Ab0HCUmQ (ORCPT ); Tue, 3 Aug 2010 16:42:16 -0400 Content-Disposition: inline In-Reply-To: <20100803163321.GA21273@infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue 03-08-10 12:33:21, Christoph Hellwig wrote: > On Tue, Aug 03, 2010 at 06:20:38PM +0200, Jan Kara wrote: > > Background writeback and kupdate-style writeback are easily livelockable > > (from a definition of their target). This is inconvenient because it can > > make sync(1) stall forever waiting on its queued work to be finished. > > Fix the problem by interrupting background and kupdate writeback if there > > is some other work to do. We can return to them after completing all the > > queued work. > > I don't think this is quite correct. If the only other callers was > fsync_filesystems that would be true, but we also have the odd > writeback_if_idle hack in ext4, and the bdi_start_writeback hack > in laptop mode. Yes, I'm aware of these. But do they really matter? bdi_start_writeback() hack is almost like background writeback (it's write-it-all thing) and so yielding to it does not change much. Similarly the writeback_if_idle thing (although that works only for a single sb which makes difference if there are several active filesystems on the bdi). But regardless of what other work items actually do, I view background / kupdate writeback as the type of thing we do when noone else sends bdi dirty data to the backing device. So if someone has actually idea what to write out, we give it priority and then return to doing our background / kupdate writeback. What do you think? Honza -- Jan Kara SUSE Labs, CR