From patchwork Tue Apr 23 09:31:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 238831 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 7B8B42C0092 for ; Tue, 23 Apr 2013 19:31:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756200Ab3DWJbK (ORCPT ); Tue, 23 Apr 2013 05:31:10 -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 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7986FA51FE; Tue, 23 Apr 2013 11:31:08 +0200 (CEST) Received: by quack.suse.cz (Postfix, from userid 1000) id 202BF2063D; Tue, 23 Apr 2013 11:31:07 +0200 (CEST) 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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: Honza 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); }