On Friday 15 February 2008, Dongjun Shin wrote:
> Hello,
>
> When I'm running postmark on btrfs v0.12, although the system
> must be busy doing the I/O, there are some cases where the I/O is idle
> while btrfs workqueue eats up most of the CPU time.
>

I wasn't able to reproduce this on my small ssd, but I could trigger it on my 
larger sata drive.  Most of the time we seem to be stuck in 
btrfs_realloc_node, which is part of the defrag.

The attached patch disables defrag in ssd mode, or you can grab the latest 
from btrfs-unstable:

http://oss.oracle.com/mercurial/mason/btrfs-unstable/archive/1cc5025e42bb.tar.gz

I had left defrag on in ssd mode because earlier tests showed it still helped 
in some read workloads.  This doesn't seem to be the case anymore, but if you 
see read regressions, please let me know.

(updated no-defrag patch below)

-chris
changeset:   433:1cc5025e42bb
tag:         tip
user:        Chris Mason <[EMAIL PROTECTED]>
date:        Fri Feb 15 13:19:35 2008 -0500
summary:     Disable tree defrag in SSD mode

diff -r 038efc036e0d -r 1cc5025e42bb extent-tree.c
--- a/extent-tree.c	Fri Feb 15 10:40:52 2008 -0500
+++ b/extent-tree.c	Fri Feb 15 13:19:35 2008 -0500
@@ -1835,7 +1835,8 @@ struct extent_buffer *__btrfs_alloc_free
 			buf->start, buf->start + buf->len - 1,
 			EXTENT_CSUM, GFP_NOFS);
 	buf->flags |= EXTENT_CSUM;
-	btrfs_set_buffer_defrag(buf);
+	if (!btrfs_test_opt(root, SSD))
+		btrfs_set_buffer_defrag(buf);
 	trans->blocks_used++;
 	return buf;
 }
diff -r 038efc036e0d -r 1cc5025e42bb tree-defrag.c
--- a/tree-defrag.c	Fri Feb 15 10:40:52 2008 -0500
+++ b/tree-defrag.c	Fri Feb 15 13:19:35 2008 -0500
@@ -179,6 +179,9 @@ int btrfs_defrag_leaves(struct btrfs_tra
 	if (root->ref_cows == 0 && !is_extent)
 		goto out;
 
+	if (btrfs_test_opt(root, SSD))
+		goto out;
+
 	path = btrfs_alloc_path();
 	if (!path)
 		return -ENOMEM;

_______________________________________________
Btrfs-devel mailing list
[email protected]
http://oss.oracle.com/mailman/listinfo/btrfs-devel

Reply via email to