Lines Matching refs:min_nr
129 BUG_ON(pool->curr_nr >= pool->min_nr);
185 int mempool_init_node(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn,
190 pool->min_nr = min_nr;
196 pool->elements = kmalloc_array_node(min_nr, sizeof(void *),
204 while (pool->curr_nr < pool->min_nr) {
222 * @min_nr: the minimum number of elements guaranteed to be
233 int mempool_init(mempool_t *pool, int min_nr, mempool_alloc_t *alloc_fn,
236 return mempool_init_node(pool, min_nr, alloc_fn, free_fn,
244 * @min_nr: the minimum number of elements guaranteed to be
258 mempool_t *mempool_create(int min_nr, mempool_alloc_t *alloc_fn,
261 return mempool_create_node(min_nr, alloc_fn, free_fn, pool_data,
266 mempool_t *mempool_create_node(int min_nr, mempool_alloc_t *alloc_fn,
276 if (mempool_init_node(pool, min_nr, alloc_fn, free_fn, pool_data,
314 if (new_min_nr <= pool->min_nr) {
321 pool->min_nr = new_min_nr;
333 if (unlikely(new_min_nr <= pool->min_nr)) {
343 pool->min_nr = new_min_nr;
345 while (pool->curr_nr < pool->min_nr) {
351 if (pool->curr_nr < pool->min_nr) {
482 * if curr_nr + #allocated == min_nr. Testing curr_nr < min_nr
488 * min_nr is guaranteed to see curr_nr < min_nr unless curr_nr gets
489 * incremented to min_nr afterwards. If curr_nr gets incremented
490 * to min_nr after the allocation of @element, the elements
497 if (unlikely(READ_ONCE(pool->curr_nr) < pool->min_nr)) {
499 if (likely(pool->curr_nr < pool->min_nr)) {