Browse Source

Btrfs: don't wait as long for more batches during SSD log commit

When we're doing log commits, we try to wait for more writers to come in
and make the commit bigger.  This helps improve performance on rotating
disks, but on SSDs it adds latencies.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Chris Mason 14 năm trước cách đây
mục cha
commit
cd354ad613
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      fs/btrfs/tree-log.c

+ 2 - 2
fs/btrfs/tree-log.c

@@ -2013,10 +2013,10 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
 	/* wait for previous tree log sync to complete */
 	/* wait for previous tree log sync to complete */
 	if (atomic_read(&root->log_commit[(index1 + 1) % 2]))
 	if (atomic_read(&root->log_commit[(index1 + 1) % 2]))
 		wait_log_commit(trans, root, root->log_transid - 1);
 		wait_log_commit(trans, root, root->log_transid - 1);
-
 	while (1) {
 	while (1) {
 		unsigned long batch = root->log_batch;
 		unsigned long batch = root->log_batch;
-		if (root->log_multiple_pids) {
+		/* when we're on an ssd, just kick the log commit out */
+		if (!btrfs_test_opt(root, SSD) && root->log_multiple_pids) {
 			mutex_unlock(&root->log_mutex);
 			mutex_unlock(&root->log_mutex);
 			schedule_timeout_uninterruptible(1);
 			schedule_timeout_uninterruptible(1);
 			mutex_lock(&root->log_mutex);
 			mutex_lock(&root->log_mutex);