From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [PATCH 1/2] writeback: Improve busyloop prevention Date: Thu, 8 Sep 2011 15:49:20 +0200 Message-ID: <20110908134920.GA28149@quack.suse.cz> References: <1315442684-26754-1-git-send-email-jack@suse.cz> <20110908005750.GA12712@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jan Kara , "linux-fsdevel@vger.kernel.org" , Dave Chinner , Christoph Hellwig To: Wu Fengguang Return-path: Received: from cantor2.suse.de ([195.135.220.15]:42799 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932789Ab1IHNtb (ORCPT ); Thu, 8 Sep 2011 09:49:31 -0400 Content-Disposition: inline In-Reply-To: <20110908005750.GA12712@localhost> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu 08-09-11 08:57:50, Wu Fengguang wrote: > On Thu, Sep 08, 2011 at 08:44:43AM +0800, Jan Kara wrote: > > Writeback of an inode can be stalled by things like internal fs locks being > > held. So in case we didn't write anything during a pass through b_io list, > > just wait for a moment and try again. > > Reviewed-by: Wu Fengguang > > with comments below. > > > + trace_writeback_wait(wb->bdi, work); > > + spin_unlock(&wb->list_lock); > > __set_current_state(TASK_INTERRUPTIBLE); Ah, right. Thanks for catching this. > > > + schedule_timeout(pause); > > > + pause <<= 1; > > + if (pause > HZ / 10) > > + pause = HZ / 10; > > It's a bit more safer to do > > if (pause < HZ / 10) > pause <<= 1; > > in case someone hacked HZ=1. Good idea. Done. Thanks for review. Honza -- Jan Kara SUSE Labs, CR