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>
This commit is contained in:
parent
2882064076
commit
61445b56d0
@ -402,6 +402,8 @@ int __sbitmap_queue_get_shallow(struct sbitmap_queue *sbq,
|
|||||||
unsigned int hint, depth;
|
unsigned int hint, depth;
|
||||||
int nr;
|
int nr;
|
||||||
|
|
||||||
|
WARN_ON_ONCE(shallow_depth < sbq->min_shallow_depth);
|
||||||
|
|
||||||
hint = this_cpu_read(*sbq->alloc_hint);
|
hint = this_cpu_read(*sbq->alloc_hint);
|
||||||
depth = READ_ONCE(sbq->sb.depth);
|
depth = READ_ONCE(sbq->sb.depth);
|
||||||
if (unlikely(hint >= depth)) {
|
if (unlikely(hint >= depth)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user