All of lore.kernel.org
 help / color / mirror / Atom feed
* PLEASE TEST: Everybody who is seeing weird and long hangs
@ 2011-08-01 15:21 Josef Bacik
  2011-08-01 15:45 ` Chris Mason
  0 siblings, 1 reply; 8+ messages in thread
From: Josef Bacik @ 2011-08-01 15:21 UTC (permalink / raw)
  To: linux-btrfs

Hello,

We've seen a lot of reports of people having these constant long pauses
when doing things like sync or such.  The stack traces usually all look
the same, one is btrfs-transaction stuck in btrfs_wait_marked_extents
and one is btrfs-submit-# stuck in get_request_wait.  I had originally
thought this was due to the new plugging stuff, but I think it just
makes the problem happen more quickly as we've seen that 2.6.38 which we
thought was ok will still have the problem happen if given enough time.

I _think_ this is because of the way we write out metadata in the
transaction commit phase.  We're doing write_on_page for every dirty
page in the btree during the commit.  This sucks because basically we
end up with one bio per page, which makes us blow out our nr_requests
constantly, which is why btrfs-submit-# is always stuck in
get_request_wait.  What we need to do instead is use filemap_fdatawrite
which will do a WB_SYNC_ALL but will do it via writepages, so hopefully
we will get less bios and this problem will go away.  Please try this
very hastily put together patch if you are experiencing this problem and
let me know if it fixes it for you.  Thanks,

Josef

diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index eb55863..86217a4 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -577,15 +577,17 @@ int btrfs_end_transaction_dmeta(struct
btrfs_trans_handle *trans,
 int btrfs_write_marked_extents(struct btrfs_root *root,
 			       struct extent_io_tree *dirty_pages, int mark)
 {
-	int ret;
-	int err = 0;
-	int werr = 0;
-	struct page *page;
+//	int ret;
+//	int err = 0;
+//	int werr = 0;
+//	struct page *page;
 	struct inode *btree_inode = root->fs_info->btree_inode;
-	u64 start = 0;
-	u64 end;
-	unsigned long index;
+//	u64 start = 0;
+//	u64 end;
+//	unsigned long index;

+	return filemap_fdatawrite(btree_inode->i_mapping);
+	/*
 	while (1) {
 		ret = find_first_extent_bit(dirty_pages, start, &start, &end,
 					    mark);
@@ -624,7 +626,8 @@ int btrfs_write_marked_extents(struct btrfs_root *root,
 	}
 	if (err)
 		werr = err;
-	return werr;
+	*/
+//	return werr;
 }

 /*

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-02  0:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01 15:21 PLEASE TEST: Everybody who is seeing weird and long hangs Josef Bacik
2011-08-01 15:45 ` Chris Mason
2011-08-01 16:03   ` Josef Bacik
2011-08-01 17:54     ` Chris Mason
2011-08-01 18:01       ` Josef Bacik
2011-08-01 18:21         ` Chris Mason
2011-08-01 23:28           ` cwillu
2011-08-02  0:09             ` Chris Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.