btrfs: add cond_resched to btrfs_qgroup_trace_leaf_items
authorJeff Mahoney <jeffm@suse.com>
Tue, 20 Jun 2017 12:15:26 +0000 (08:15 -0400)
committerDavid Sterba <dsterba@suse.com>
Wed, 21 Jun 2017 13:48:01 +0000 (15:48 +0200)
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>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/qgroup.c

index 458fec01d814d75ad8f0d06becb9af93e19bfd1c..7d16f0692d73745e5e86f8aa77226d806da171dd 100644 (file)
@@ -1559,6 +1559,7 @@ int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
                if (ret)
                        return ret;
        }
+       cond_resched();
        return 0;
 }