diff options
author | Omar Sandoval <osandov@fb.com> | 2018-05-09 20:29:24 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-05-10 13:27:52 -0400 |
commit | 61445b56d031bc12feafb477848cf4ef9a725fc9 (patch) | |
tree | f4e6aef2571f9566c287342f4fe0fc9fa37c3a61 /lib/sbitmap.c | |
parent | 2882064076c80ed643fe9c78ed7d493446bc5e0d (diff) |
sbitmap: warn if using smaller shallow depth than was setup
Make sure the user passed the right value to
sbitmap_queue_min_shallow_depth().
Acked-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/sbitmap.c')
-rw-r--r-- | lib/sbitmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sbitmap.c b/lib/sbitmap.c index d21473b42465..8f0950fbaa5c 100644 --- a/lib/sbitmap.c +++ b/lib/sbitmap.c | |||
@@ -402,6 +402,8 @@ int __sbitmap_queue_get_shallow(struct sbitmap_queue *sbq, | |||
402 | unsigned int hint, depth; | 402 | unsigned int hint, depth; |
403 | int nr; | 403 | int nr; |
404 | 404 | ||
405 | WARN_ON_ONCE(shallow_depth < sbq->min_shallow_depth); | ||
406 | |||
405 | hint = this_cpu_read(*sbq->alloc_hint); | 407 | hint = this_cpu_read(*sbq->alloc_hint); |
406 | depth = READ_ONCE(sbq->sb.depth); | 408 | depth = READ_ONCE(sbq->sb.depth); |
407 | if (unlikely(hint >= depth)) { | 409 | if (unlikely(hint >= depth)) { |