Lines Matching refs:depth

14 	unsigned depth = sb->depth;
20 if (depth && !sb->round_robin) {
24 *per_cpu_ptr(sb->alloc_hint, i) = get_random_u32_below(depth);
30 unsigned int depth)
35 if (unlikely(hint >= depth)) {
36 hint = depth ? get_random_u32_below(depth) : 0;
44 unsigned int depth,
54 if (hint >= depth - 1)
83 int sbitmap_init_node(struct sbitmap *sb, unsigned int depth, int shift,
90 shift = sbitmap_calculate_shift(depth);
97 sb->depth = depth;
98 sb->map_nr = DIV_ROUND_UP(sb->depth, bits_per_word);
101 if (depth == 0) {
123 void sbitmap_resize(struct sbitmap *sb, unsigned int depth)
131 sb->depth = depth;
132 sb->map_nr = DIV_ROUND_UP(sb->depth, bits_per_word);
136 static int __sbitmap_get_word(unsigned long *word, unsigned long depth,
145 nr = find_next_zero_bit(word, depth, hint);
146 if (unlikely(nr >= depth)) {
163 if (hint >= depth - 1)
171 unsigned int depth,
178 nr = __sbitmap_get_word(&map->word, depth,
190 unsigned int depth,
202 depth),
242 unsigned int hint, depth;
247 depth = READ_ONCE(sb->depth);
248 hint = update_alloc_hint_before_get(sb, depth);
250 update_alloc_hint_after_get(sb, depth, hint, nr);
271 unsigned int hint, depth;
276 depth = READ_ONCE(sb->depth);
277 hint = update_alloc_hint_before_get(sb, depth);
279 update_alloc_hint_after_get(sb, depth, hint, nr);
326 seq_printf(m, "depth=%u\n", sb->depth);
385 unsigned int depth)
392 * batch size is small enough that the full depth of the bitmap,
393 * potentially limited by a shallow depth, is enough to wake up all of
397 * be a partial word. There are depth / bits_per_word full words and
398 * depth % bits_per_word bits left over. In bitwise arithmetic:
401 * depth / bits_per_word = depth >> shift
402 * depth % bits_per_word = depth & ((1 << shift) - 1)
407 depth = ((depth >> sbq->sb.shift) * shallow_depth +
408 min(depth & ((1U << sbq->sb.shift) - 1), shallow_depth));
409 wake_batch = clamp_t(unsigned int, depth / SBQ_WAIT_QUEUES, 1,
415 int sbitmap_queue_init_node(struct sbitmap_queue *sbq, unsigned int depth,
421 ret = sbitmap_init_node(&sbq->sb, depth, shift, flags, node,
427 sbq->wake_batch = sbq_calc_wake_batch(sbq, depth);
447 unsigned int depth)
451 wake_batch = sbq_calc_wake_batch(sbq, depth);
460 unsigned int depth = (sbq->sb.depth + users - 1) / users;
462 wake_batch = clamp_val(depth / SBQ_WAIT_QUEUES,
469 void sbitmap_queue_resize(struct sbitmap_queue *sbq, unsigned int depth)
471 sbitmap_queue_update_wake_batch(sbq, depth);
472 sbitmap_resize(&sbq->sb, depth);
486 unsigned int hint, depth;
493 depth = READ_ONCE(sb->depth);
494 hint = update_alloc_hint_before_get(sb, depth);
520 update_alloc_hint_after_get(sb, depth, hint,
547 sbitmap_queue_update_wake_batch(sbq, sbq->sb.depth);
605 if (likely(!sb->round_robin && tag < sb->depth))