Commit 820c9b5f authored by Shile Zhang's avatar Shile Zhang Committed by Khalid Elmously

bcache: add cond_resched() in __bch_cache_cmp()

BugLink: https://bugs.launchpad.net/bugs/1840043

Read /sys/fs/bcache/<uuid>/cacheN/priority_stats can take very long
time with huge cache after long run.
Signed-off-by: default avatarShile Zhang <shile.zhang@linux.alibaba.com>
Tested-by: default avatarHeitor Alves de Siqueira <halves@canonical.com>
Signed-off-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
(backported from commit d55a4ae9)
Signed-off-by: default avatarHeitor Alves de Siqueira <halves@canonical.com>
Acked-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 3fa82914
......@@ -820,7 +820,7 @@ SHOW(__bch_cache)
if (attr == &sysfs_priority_stats) {
int cmp(const void *l, const void *r)
{ return *((uint16_t *) r) - *((uint16_t *) l); }
{ cond_resched(); return *((uint16_t *) r) - *((uint16_t *) l); }
struct bucket *b;
size_t n = ca->sb.nbuckets, i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment