Lines Matching full:hint
108 unsigned int hint, bool wrap) in __sbitmap_get_word() argument
110 unsigned int orig_hint = hint; in __sbitmap_get_word()
114 nr = find_next_zero_bit(word, depth, hint); in __sbitmap_get_word()
121 if (orig_hint && hint && wrap) { in __sbitmap_get_word()
122 hint = orig_hint = 0; in __sbitmap_get_word()
131 hint = nr + 1; in __sbitmap_get_word()
132 if (hint >= depth - 1) in __sbitmap_get_word()
133 hint = 0; in __sbitmap_get_word()
426 unsigned int hint, depth; in __sbitmap_queue_get() local
429 hint = this_cpu_read(*sbq->alloc_hint); in __sbitmap_queue_get()
431 if (unlikely(hint >= depth)) { in __sbitmap_queue_get()
432 hint = depth ? prandom_u32() % depth : 0; in __sbitmap_queue_get()
433 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get()
435 nr = sbitmap_get(&sbq->sb, hint, sbq->round_robin); in __sbitmap_queue_get()
438 /* If the map is full, a hint won't do us much good. */ in __sbitmap_queue_get()
440 } else if (nr == hint || unlikely(sbq->round_robin)) { in __sbitmap_queue_get()
441 /* Only update the hint if we used it. */ in __sbitmap_queue_get()
442 hint = nr + 1; in __sbitmap_queue_get()
443 if (hint >= depth - 1) in __sbitmap_queue_get()
444 hint = 0; in __sbitmap_queue_get()
445 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get()
455 unsigned int hint, depth; in __sbitmap_queue_get_shallow() local
460 hint = this_cpu_read(*sbq->alloc_hint); in __sbitmap_queue_get_shallow()
462 if (unlikely(hint >= depth)) { in __sbitmap_queue_get_shallow()
463 hint = depth ? prandom_u32() % depth : 0; in __sbitmap_queue_get_shallow()
464 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get_shallow()
466 nr = sbitmap_get_shallow(&sbq->sb, hint, shallow_depth); in __sbitmap_queue_get_shallow()
469 /* If the map is full, a hint won't do us much good. */ in __sbitmap_queue_get_shallow()
471 } else if (nr == hint || unlikely(sbq->round_robin)) { in __sbitmap_queue_get_shallow()
472 /* Only update the hint if we used it. */ in __sbitmap_queue_get_shallow()
473 hint = nr + 1; in __sbitmap_queue_get_shallow()
474 if (hint >= depth - 1) in __sbitmap_queue_get_shallow()
475 hint = 0; in __sbitmap_queue_get_shallow()
476 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get_shallow()