Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fusionio.com>
To: Stefan Priebe <s.priebe@profihost.ag>
Cc: Josef Bacik <JBacik@fusionio.com>,
	Chris Mason <clmason@fusionio.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: No space left on device (28)
Date: Tue, 26 Mar 2013 15:38:05 -0400	[thread overview]
Message-ID: <20130326193805.GG28030@localhost.localdomain> (raw)
In-Reply-To: <5151F56C.5070502@profihost.ag>

On Tue, Mar 26, 2013 at 01:22:20PM -0600, Stefan Priebe wrote:
> Hi,
> 
> but when i transfer big files i see now this one:
> [20368.784736] INFO: task rsync:14911 blocked for more than 120 seconds.
> [20368.821978] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" 
> disables this message.
> [20368.895140] rsync           D ffffffff8160f580     0 14911      1 
> 0x00000000
> [20368.895148]  ffff8801ca63fc78 0000000000000086 ffff8800c28f8198 
> ffff88022394f800
> [20368.895158]  ffff8801ca63ffd8 ffff8801ca63ffd8 ffff8801ca63ffd8 
> 0000000000012c40
> [20368.895163]  ffffffff81a11440 ffff8801c9d36340 ffff8801ca63fc88 
> ffff8801cefce130
> [20368.895169] Call Trace:
> [20368.895180]  [<ffffffff8151a774>] schedule+0x24/0x70
> [20368.895207]  [<ffffffffa0158c75>] 
> wait_current_trans.isra.32+0x95/0x100 [btrfs]
> [20368.895214]  [<ffffffff8106d4f0>] ? add_wait_queue+0x60/0x60
> [20368.895236]  [<ffffffffa015a45d>] 
> start_transaction.part.33+0x13d/0x4d0 [btrfs]
> [20368.895252]  [<ffffffff811420f3>] ? inode_permission+0x13/0x50
> [20368.895271]  [<ffffffffa015a814>] start_transaction+0x24/0x30 [btrfs]
> [20368.895287]  [<ffffffffa015aae3>] btrfs_start_transaction+0x13/0x20 
> [btrfs]
> [20368.895302]  [<ffffffffa015b2f0>] __unlink_start_trans+0x70/0x460 [btrfs]
> [20368.895307]  [<ffffffff8150ee3e>] ? check_acl+0x5a/0x122
> [20368.895312]  [<ffffffff81055ff0>] ? ns_capable+0x30/0x60
> [20368.895317]  [<ffffffff811413bd>] ? generic_permission+0xbd/0x110
> [20368.895336]  [<ffffffffa0163f92>] btrfs_unlink+0x32/0xc0 [btrfs]
> [20368.895341]  [<ffffffff8114186d>] vfs_unlink.part.61+0x6d/0xd0
> [20368.895345]  [<ffffffff81143ad7>] vfs_unlink+0x37/0x50
> [20368.895349]  [<ffffffff81143c8b>] do_unlinkat+0x19b/0x240
> [20368.895354]  [<ffffffff81146171>] sys_unlink+0x11/0x20
> [20368.895359]  [<ffffffff8151c2e9>] system_call_fastpath+0x16/0x1b
> 
> Speed is just 100kb/s instead of 100MB/s.
> 

Hrm I wonder if 512 is too small for your case, can you add this patch to the
pile and see what dmesg says when you are having these problems?  Thanks,

Josef


diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 50767bb..d19c9f6 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -31,6 +31,7 @@
 #include "inode-map.h"
 #include "volumes.h"
 #include "dev-replace.h"
+#include "math.h"
 
 #define BTRFS_ROOT_TRANS_TAG 0
 
@@ -576,10 +577,19 @@ void btrfs_throttle(struct btrfs_root *root)
 static int should_end_transaction(struct btrfs_trans_handle *trans,
 				  struct btrfs_root *root)
 {
-	int ret;
+	struct btrfs_block_rsv *block_rsv = &root->fs_info->global_block_rsv;
+	u64 num_bytes = 0;
+	int ret = 1;
 
-	ret = btrfs_block_rsv_check(root, &root->fs_info->global_block_rsv, 5);
-	return ret ? 1 : 0;
+	spin_lock(&block_rsv->lock);
+	num_bytes = div_factor(block_rsv->size, 5);
+	if (block_rsv->reserved >= num_bytes)
+		ret = 0;
+	else
+		printk(KERN_ERR "we're pretty low, setting blocked, reserved %Lu, size %Lu, num %Lu\n",
+		       block_rsv->reserved, block_rsv->size, num_bytes);
+	spin_unlock(&block_rsv->lock);
+	return ret;
 }
 
 int btrfs_should_end_transaction(struct btrfs_trans_handle *trans,
-- 
1.7.7.6


  reply	other threads:[~2013-03-26 19:38 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21  8:03 No space left on device (28) Stefan Priebe - Profihost AG
2013-03-21 18:00 ` Chris Mason
2013-03-21 18:35   ` Stefan Priebe - Profihost AG
2013-03-21 19:02     ` Chris Mason
2013-03-21 19:42       ` Stefan Priebe
2013-03-22  6:08         ` Stefan Priebe - Profihost AG
2013-03-22 12:11           ` Stefan Priebe - Profihost AG
2013-03-22 13:53             ` Josef Bacik
2013-03-22 13:56               ` Stefan Priebe - Profihost AG
2013-03-22 15:54                 ` Josef Bacik
2013-03-22 19:10                   ` Stefan Priebe
2013-03-22 20:49                     ` Josef Bacik
2013-03-22 20:55                       ` Stefan Priebe
2013-03-25 20:14                         ` Josef Bacik
2013-03-26  7:45                           ` Stefan Priebe
2013-03-26 12:53                             ` Josef Bacik
2013-03-26 12:55                               ` Stefan Priebe - Profihost AG
2013-03-26 13:30                                 ` Josef Bacik
2013-03-26 13:49                                   ` Stefan Priebe - Profihost AG
2013-03-26 14:44                                     ` Josef Bacik
2013-03-26 15:03                                       ` Stefan Priebe - Profihost AG
2013-03-26 15:25                                         ` Josef Bacik
2013-03-26 16:19                                           ` Stefan Priebe
2013-03-26 17:45                                             ` Josef Bacik
2013-03-26 19:05                                               ` Stefan Priebe
2013-03-26 19:16                                                 ` Josef Bacik
2013-03-26 19:22                                                   ` Stefan Priebe
2013-03-26 19:38                                                     ` Josef Bacik [this message]
2013-03-26 19:47                                                       ` Stefan Priebe
2013-03-22  6:13         ` Roman Mamedov
2013-03-22  6:24           ` cwillu
2013-03-22  6:39             ` Stefan Priebe - Profihost AG
2013-03-22  6:41               ` cwillu
2013-03-22  7:06                 ` Stefan Priebe - Profihost AG
2013-03-22  6:38           ` Stefan Priebe - Profihost AG

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130326193805.GG28030@localhost.localdomain \
    --to=jbacik@fusionio.com \
    --cc=clmason@fusionio.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=s.priebe@profihost.ag \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox