diff mbox

stalls with latest btrfs merge into 3.0-rc2

Message ID 4DF6B301.90904@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Josef Bacik June 14, 2011, 1:01 a.m. UTC
On 06/13/2011 05:07 PM, Jim Schutt wrote:
> Hi,
>
> On a system under a heavy write load from multiple ceph OSDs,
> I'm running into the following hung tasks where btrfs is implicated.
> I'm running commit 3c25fa740e2 from Linus' tree merged with
> commit cb9b41c92fa from git://ceph.newdream.net/git/ceph-client.git.
>

Please try this patch and verify it fixes the problem.  If it does I'll 
make it less crappy and send it along.  Thanks,

Josef

Comments

Jim Schutt June 14, 2011, 3:13 p.m. UTC | #1
Josef Bacik wrote:
> On 06/13/2011 05:07 PM, Jim Schutt wrote:
>> Hi,
>>
>> On a system under a heavy write load from multiple ceph OSDs,
>> I'm running into the following hung tasks where btrfs is implicated.
>> I'm running commit 3c25fa740e2 from Linus' tree merged with
>> commit cb9b41c92fa from git://ceph.newdream.net/git/ceph-client.git.
>>
> 
> Please try this patch and verify it fixes the problem.  If it does I'll 
> make it less crappy and send it along.  Thanks,

I saw no stalls with your patch applied after 30 minutes of writing,
whereas without it the stalls would trigger after a few minutes.

Let me know if you get a new version you'd like me to test, otherwise

Tested-by: Jim Schutt <jaschut@sandia.gov>

Thanks -- Jim

> 
> Josef
> 


--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 7a9f517..532139e 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1236,12 +1236,16 @@  int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
 			schedule_timeout(1);
 
 		finish_wait(&cur_trans->writer_wait, &wait);
-		spin_lock(&root->fs_info->trans_lock);
-		root->fs_info->trans_no_join = 1;
-		spin_unlock(&root->fs_info->trans_lock);
 	} while (atomic_read(&cur_trans->num_writers) > 1 ||
 		 (should_grow && cur_trans->num_joined != joined));
 
+	spin_lock(&root->fs_info->trans_lock);
+	root->fs_info->trans_no_join = 1;
+	spin_unlock(&root->fs_info->trans_lock);
+
+	while (atomic_read(&cur_trans->num_writers) > 1)
+		schedule_timeout(1);
+
 	ret = create_pending_snapshots(trans, root->fs_info);
 	BUG_ON(ret);