Lines Matching full:hint
83 unsigned int hint, bool wrap) in __sbitmap_get_word() argument
85 unsigned int orig_hint = hint; in __sbitmap_get_word()
89 nr = find_next_zero_bit(word, depth, hint); in __sbitmap_get_word()
96 if (orig_hint && hint && wrap) { in __sbitmap_get_word()
97 hint = orig_hint = 0; in __sbitmap_get_word()
106 hint = nr + 1; in __sbitmap_get_word()
107 if (hint >= depth - 1) in __sbitmap_get_word()
108 hint = 0; in __sbitmap_get_word()
374 unsigned int hint, depth; in __sbitmap_queue_get() local
377 hint = this_cpu_read(*sbq->alloc_hint); in __sbitmap_queue_get()
379 if (unlikely(hint >= depth)) { in __sbitmap_queue_get()
380 hint = depth ? prandom_u32() % depth : 0; in __sbitmap_queue_get()
381 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get()
383 nr = sbitmap_get(&sbq->sb, hint, sbq->round_robin); in __sbitmap_queue_get()
386 /* If the map is full, a hint won't do us much good. */ in __sbitmap_queue_get()
388 } else if (nr == hint || unlikely(sbq->round_robin)) { in __sbitmap_queue_get()
389 /* Only update the hint if we used it. */ in __sbitmap_queue_get()
390 hint = nr + 1; in __sbitmap_queue_get()
391 if (hint >= depth - 1) in __sbitmap_queue_get()
392 hint = 0; in __sbitmap_queue_get()
393 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get()
403 unsigned int hint, depth; in __sbitmap_queue_get_shallow() local
408 hint = this_cpu_read(*sbq->alloc_hint); in __sbitmap_queue_get_shallow()
410 if (unlikely(hint >= depth)) { in __sbitmap_queue_get_shallow()
411 hint = depth ? prandom_u32() % depth : 0; in __sbitmap_queue_get_shallow()
412 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get_shallow()
414 nr = sbitmap_get_shallow(&sbq->sb, hint, shallow_depth); in __sbitmap_queue_get_shallow()
417 /* If the map is full, a hint won't do us much good. */ in __sbitmap_queue_get_shallow()
419 } else if (nr == hint || unlikely(sbq->round_robin)) { in __sbitmap_queue_get_shallow()
420 /* Only update the hint if we used it. */ in __sbitmap_queue_get_shallow()
421 hint = nr + 1; in __sbitmap_queue_get_shallow()
422 if (hint >= depth - 1) in __sbitmap_queue_get_shallow()
423 hint = 0; in __sbitmap_queue_get_shallow()
424 this_cpu_write(*sbq->alloc_hint, hint); in __sbitmap_queue_get_shallow()