diff mbox

btrfs: add cond_resched to btrfs_qgroup_trace_leaf_items

Message ID 20170620121526.13661-1-jeffm@suse.com
State New, archived
Headers show

Commit Message

Jeff Mahoney June 20, 2017, 12:15 p.m. UTC
From: Jeff Mahoney <jeffm@suse.com>

On an uncontended system, we can end up hitting soft lockups while
doing replace_path.  At the core, and frequently called is
btrfs_qgroup_trace_leaf_items, so it makes sense to add a cond_resched
there.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/btrfs/qgroup.c | 1 +
 1 file changed, 1 insertion(+)

Comments

David Sterba June 21, 2017, 1:47 p.m. UTC | #1
On Tue, Jun 20, 2017 at 08:15:26AM -0400, jeffm@suse.com wrote:
> From: Jeff Mahoney <jeffm@suse.com>
> 
> On an uncontended system, we can end up hitting soft lockups while
> doing replace_path.  At the core, and frequently called is
> btrfs_qgroup_trace_leaf_items, so it makes sense to add a cond_resched
> there.
> 
> Signed-off-by: Jeff Mahoney <jeffm@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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/qgroup.c b/fs/btrfs/qgroup.c
index deffbeb74a0b..7a3cfa22e178 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1559,6 +1559,7 @@  int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
 		if (ret)
 			return ret;
 	}
+	cond_resched();
 	return 0;
 }