Lines Matching refs:min_nr
122 BUG_ON(pool->curr_nr >= pool->min_nr);
178 int mempool_init_node(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn,
183 pool->min_nr = min_nr;
189 pool->elements = kmalloc_array_node(min_nr, sizeof(void *),
197 while (pool->curr_nr < pool->min_nr) {
215 * @min_nr: the minimum number of elements guaranteed to be
226 int mempool_init(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn,
229 return mempool_init_node(pool, min_nr, alloc_fn, free_fn,
237 * @min_nr: the minimum number of elements guaranteed to be
251 mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
254 return mempool_create_node(min_nr,alloc_fn,free_fn, pool_data,
259 mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
269 if (mempool_init_node(pool, min_nr, alloc_fn, free_fn, pool_data,
307 if (new_min_nr <= pool->min_nr) {
314 pool->min_nr = new_min_nr;
326 if (unlikely(new_min_nr <= pool->min_nr)) {
336 pool->min_nr = new_min_nr;
338 while (pool->curr_nr < pool->min_nr) {
344 if (pool->curr_nr < pool->min_nr) {
475 * if curr_nr + #allocated == min_nr. Testing curr_nr < min_nr
481 * min_nr is guaranteed to see curr_nr < min_nr unless curr_nr gets
482 * incremented to min_nr afterwards. If curr_nr gets incremented
483 * to min_nr after the allocation of @element, the elements
490 if (unlikely(READ_ONCE(pool->curr_nr) < pool->min_nr)) {
492 if (likely(pool->curr_nr < pool->min_nr)) {