Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756567Ab3DWJbL (ORCPT ); Tue, 23 Apr 2013 05:31:11 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39117 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755512Ab3DWJbJ (ORCPT ); Tue, 23 Apr 2013 05:31:09 -0400 Date: Tue, 23 Apr 2013 11:31:07 +0200 From: Jan Kara To: Jeff Moyer Cc: Mel Gorman , "Theodore Ts'o" , Dave Chinner , Jan Kara , linux-ext4@vger.kernel.org, LKML , Linux-MM , Jiri Slaby Subject: Re: Excessive stall times on ext4 in 3.9-rc2 Message-ID: <20130423093107.GF4596@quack.suse.cz> References: <20130410105608.GC1910@suse.de> <20130410131245.GC4862@thunk.org> <20130411170402.GB11656@suse.de> <20130411183512.GA12298@thunk.org> <20130411213335.GE9379@quack.suse.cz> <20130412025708.GB7445@thunk.org> <20130412045042.GA30622@dastard> <20130412151952.GA4944@thunk.org> <20130422143846.GA2675@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1195 Lines: 34 On Mon 22-04-13 18:42:23, Jeff Moyer wrote: > Jan, if I were to come up with a way of promoting a particular async > queue to the front of the line, where would I put such a call in the > ext4/jbd2 code to be effective? As Ted wrote the simplies might be to put his directly in __lock_buffer(). Something like: diff --git a/fs/buffer.c b/fs/buffer.c index b4dcb34..e026a3e 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -69,6 +69,12 @@ static int sleep_on_buffer(void *word) void __lock_buffer(struct buffer_head *bh) { + /* + * Likely under async writeback? Tell io scheduler we are + * now waiting for the IO... + */ + if (PageWriteback(bh->b_page)) + io_now_sync(bh->b_bdev, bh->b_blocknr); wait_on_bit_lock(&bh->b_state, BH_Lock, sleep_on_buffer, TASK_UNINTERRUPTIBLE); } Honza -- Jan Kara SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/