From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: Re: [PATCH 1/2] writeback: Improve busyloop prevention Date: Thu, 8 Sep 2011 08:57:50 +0800 Message-ID: <20110908005750.GA12712@localhost> References: <1315442684-26754-1-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "linux-fsdevel@vger.kernel.org" , Dave Chinner , Christoph Hellwig To: Jan Kara Return-path: Received: from mga03.intel.com ([143.182.124.21]:59732 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753699Ab1IHA55 (ORCPT ); Wed, 7 Sep 2011 20:57:57 -0400 Content-Disposition: inline In-Reply-To: <1315442684-26754-1-git-send-email-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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); > + 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. Thanks, Fengguang