From patchwork Mon Jul 18 18:17:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 987442 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6IIHTXW018659 for ; Mon, 18 Jul 2011 18:17:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753848Ab1GRSR1 (ORCPT ); Mon, 18 Jul 2011 14:17:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44255 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751469Ab1GRSR0 (ORCPT ); Mon, 18 Jul 2011 14:17:26 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6IIHL8E026154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 18 Jul 2011 14:17:22 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6IIHL1B029182; Mon, 18 Jul 2011 14:17:21 -0400 Received: from localhost.localdomain (vpn-9-43.rdu.redhat.com [10.11.9.43]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p6IIHLHN017518; Mon, 18 Jul 2011 14:17:21 -0400 Message-ID: <4E2478B1.60601@redhat.com> Date: Mon, 18 Jul 2011 14:17:21 -0400 From: Josef Bacik User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Nirbheek Chauhan CC: linux-btrfs Subject: Re: Applications using fsync cause hangs for several seconds every few minutes References: In-Reply-To: X-Enigmail-Version: 1.1.2 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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]); Mon, 18 Jul 2011 18:17:30 +0000 (UTC) On 06/06/2011 06:58 PM, Nirbheek Chauhan wrote: > Hello list, > > I've been using btrfs on my personal machines for about two years now, > and on this machine for about a year with absolutely no problems. > Infact, it has held up better than ext4 with regards to reliability. > > However, recently, perhaps with 2.6.39, or after I quickly started > filling up my disk again, it has become impossible for me to work for > long periods on my machine. > > Every few minutes, (I guess) when applications do fsync (firefox, > xchat, vim, etc), all applications that use fsync() hang for several > seconds, and applications that use general IO suffer extreme > slowdowns. iotop shows various combinations of the processes listed > below doing writes, and the total write as 2-3MB/s. > > [btrfs-dealloc-] > [btrfs-submit-0] > [btrfs-transacti] > [btrfs-endio-wri] > [flush-btrfs-1] > > In some extreme cases, I've had hangs for 5 whole minutes. I'm really > beginning to appreciate how little I/O GNOME Shell does since it > remains completely responsive throughout this. I have a feeling that > the cause for this is extreme fragmentation. > > My hard disk is a 500GB SATA hdd, my btrfs partition details are: > > # btrfs filesystem show > Label: 'gentoo' uuid: 6f539d7f-f70f-4216-a4a9-6f7a2117a04a > Total devices 1 FS bytes used 246.37GB > devid 1 size 345.13GB used 345.13GB path /dev/sda7 > > Btrfs v0.19-35-g1b444cd-dirty > > What can I do to debug this issue? What other information should I > supply? Could someone guide me on how to figure out why my machine is > unusable now? > > Thanks in advance, > Hello, I've been looking into this and I have a suspicion. Would you run with this patch and see if the problem goes away? If so I'm on the right track and I'll have more test patches for you to try :). Thanks, Josef fs_info = device->dev_root->fs_info; @@ -290,7 +289,6 @@ loop_lock: spin_unlock(&device->io_lock); done: - blk_finish_plug(&plug); return 0; } --- 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 19450bc..2e30350 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -150,7 +150,6 @@ static noinline int run_scheduled_bios(struct btrfs_device *device) * 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);