From patchwork Mon Jun 27 20:17:44 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Goyal X-Patchwork-Id: 102269 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 37C68B6F69 for ; Tue, 28 Jun 2011 06:23:32 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754185Ab1F0UTM (ORCPT ); Mon, 27 Jun 2011 16:19:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754153Ab1F0URt (ORCPT ); Mon, 27 Jun 2011 16:17:49 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5RKHjuO022909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 Jun 2011 16:17:45 -0400 Received: from machine.usersys.redhat.com (dhcp-100-18-250.bos.redhat.com [10.16.18.250]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p5RKHisv027392; Mon, 27 Jun 2011 16:17:45 -0400 Received: by machine.usersys.redhat.com (Postfix, from userid 10451) id 78BC228189; Mon, 27 Jun 2011 16:17:44 -0400 (EDT) From: Vivek Goyal To: linux-kernel@vger.kernel.org, jaxboe@fusionio.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Cc: vgoyal@redhat.com, khlebnikov@openvz.org, jmoyer@redhat.com Subject: [PATCH 3/3] ext3: Explicitly specify fsync dependency on journaling thread Date: Mon, 27 Jun 2011 16:17:44 -0400 Message-Id: <1309205864-13124-4-git-send-email-vgoyal@redhat.com> In-Reply-To: <1309205864-13124-1-git-send-email-vgoyal@redhat.com> References: <1309205864-13124-1-git-send-email-vgoyal@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Set/reset fsync dependency of fsync on journalling thread. This allows CFQ to dispatch IO from journalling thread in fsync's time slice. Otherwise, lots of cfq queue idling takes place if fsync is running in a separate cgroup and journalling thread is running in root group. Signed-off-by: Vivek Goyal --- fs/ext3/fsync.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/ext3/fsync.c b/fs/ext3/fsync.c index 09b13bb..1e8de9c 100644 --- a/fs/ext3/fsync.c +++ b/fs/ext3/fsync.c @@ -82,7 +82,10 @@ int ext3_sync_file(struct file *file, int datasync) !journal_trans_will_send_data_barrier(journal, commit_tid)) needs_barrier = 1; log_start_commit(journal, commit_tid); + blk_set_depends_on_task(journal->j_dev->bd_disk->queue, + journal->j_task); ret = log_wait_commit(journal, commit_tid); + blk_reset_depends_on_task(journal->j_dev->bd_disk->queue); /* * In case we didn't commit a transaction, we have to flush