Skip to content

Commit

Permalink
bcache: add cond_resched() in __bch_cache_cmp()
Browse files Browse the repository at this point in the history
Read /sys/fs/bcache/<uuid>/cacheN/priority_stats can take very long
time with huge cache after long run.

Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
Tested-by: Heitor Alves de Siqueira <halves@canonical.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Shile Zhang authored and Jens Axboe committed Sep 3, 2019
1 parent fa99165 commit d55a4ae
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/md/bcache/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,7 @@ KTYPE(bch_cache_set_internal);

static int __bch_cache_cmp(const void *l, const void *r)
{
cond_resched();
return *((uint16_t *)r) - *((uint16_t *)l);
}

Expand Down

0 comments on commit d55a4ae

Please sign in to comment.