diff options
author | Edmund Nadolski <enadolski@suse.com> | 2017-07-12 16:20:09 -0600 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-08-16 16:12:01 +0200 |
commit | 9dd14fd6964e6db02346d5f472f915029728b8cf (patch) | |
tree | d75a9264eb13a4ded20aa652d98824bb38bb4251 /fs/btrfs/backref.c | |
parent | 00142756e1f8015d2f8ce96532d156689db7e448 (diff) | |
download | linux-stable-9dd14fd6964e6db02346d5f472f915029728b8cf.tar.gz linux-stable-9dd14fd6964e6db02346d5f472f915029728b8cf.tar.bz2 linux-stable-9dd14fd6964e6db02346d5f472f915029728b8cf.zip |
btrfs: add cond_resched() calls when resolving backrefs
Since backref resolution is CPU-intensive, the cond_resched calls
should help alleviate soft lockup occurences.
Signed-off-by: Edmund Nadolski <enadolski@suse.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r-- | fs/btrfs/backref.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 4cda81964dd4..9593102bdc2c 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -660,6 +660,7 @@ static int resolve_indirect_refs(struct btrfs_fs_info *fs_info, prelim_ref_insert(fs_info, &preftrees->direct, ref); ulist_reinit(parents); + cond_resched(); } out: ulist_free(parents); @@ -702,6 +703,7 @@ static int add_missing_keys(struct btrfs_fs_info *fs_info, btrfs_tree_read_unlock(eb); free_extent_buffer(eb); prelim_ref_insert(fs_info, &preftrees->indirect, ref); + cond_resched(); } return 0; } @@ -1243,6 +1245,7 @@ again: } eie = NULL; } + cond_resched(); } out: |