From patchwork Tue Apr 26 13:52:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Mason X-Patchwork-Id: 732812 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p3QDsf12001078 for ; Tue, 26 Apr 2011 13:54:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755916Ab1DZNyY (ORCPT ); Tue, 26 Apr 2011 09:54:24 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:19002 "EHLO rcsinet10.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755705Ab1DZNyX (ORCPT ); Tue, 26 Apr 2011 09:54:23 -0400 Received: from rcsinet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id p3QDsDEe018672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Apr 2011 13:54:15 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by rcsinet13.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id p3QDsCq3022014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Apr 2011 13:54:13 GMT Received: from abhmt020.oracle.com (abhmt020.oracle.com [141.146.116.29]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p3QDsCmf019668; Tue, 26 Apr 2011 08:54:12 -0500 Received: from localhost (/67.247.78.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Apr 2011 06:54:12 -0700 From: Chris Mason To: "Linus Torvalds" , "Linux Btrfs" , "linux-kernel" Subject: [GIT PULL] Btrfs plugging Date: Tue, 26 Apr 2011 09:52:16 -0400 Message-Id: <1303825489-sup-1263@think> User-Agent: Sup/git X-Source-IP: rcsinet13.oracle.com [148.87.113.125] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.4DB6CE8B.004A:SCFMA4539811,ss=1,fgs=0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 26 Apr 2011 13:54:41 +0000 (UTC) Hi everyone, The for-linus branch of the btrfs unstable tree: git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable.git for-linus Has a single commit for the btrfs bio submission worker threads. These gather up IOs when the checksumming or compression threads are done with the CPU intensive work. Since the submission threads go one device at a time, they want to unplug after finishing off all the bios for one device. Jens ripped this code out when he did the plugging work, I had promised to redo it in the new framework. Instead of the normal shortlog: commit 211588ad1902df57beeeadc9b44546540fa4bd81 Author: Chris Mason Date: Tue Apr 19 20:12:40 2011 -0400 Btrfs: do some plugging in the submit_bio threads The Btrfs submit bio threads have a small number of threads responsible for pushing down bios we've collected for a large number of devices. Since we do all the bios for a single device at once, we want to make sure we unplug and send down the bios for each device as we're done processing them. The new plugging API removed the btrfs code to unplug while processing bios, this adds it back with the new API. Signed-off-by: Chris Mason --- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 309a57b..c7367ae 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -155,6 +155,15 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) unsigned long limit; unsigned long last_waited = 0; int force_reg = 0; + struct blk_plug plug; + + /* + * this function runs all the bios we've collected for + * a particular device. We don't want to wander off to + * another device without first sending all of these down. + * So, setup a plug here and finish it off before we return + */ + blk_start_plug(&plug); bdi = blk_get_backing_dev_info(device->bdev); fs_info = device->dev_root->fs_info; @@ -294,6 +303,7 @@ loop_lock: spin_unlock(&device->io_lock); done: + blk_finish_plug(&plug); return 0; }