Lines Matching refs:pool
130 SPDK_ERRLOG("Failed to create small iobuf pool\n");
138 SPDK_ERRLOG("Unable to allocate requested small iobuf pool size\n");
146 SPDK_ERRLOG("Failed to create large iobuf pool\n");
154 SPDK_ERRLOG("Unable to allocate requested large iobuf pool size\n");
190 SPDK_ERRLOG("small iobuf pool count is %zu, expected %"PRIu64"\n",
195 SPDK_ERRLOG("large iobuf pool count is %zu, expected %"PRIu64"\n",
390 cache->small.pool = node->small_pool;
391 cache->large.pool = node->large_pool;
522 /* Release cached buffers back to the pool */
607 iobuf_pool_for_each_entry(struct spdk_iobuf_channel *ch, struct spdk_iobuf_pool_cache *pool,
613 STAILQ_FOREACH_SAFE(entry, pool->queue, stailq, tmp) {
657 struct spdk_iobuf_pool_cache *pool;
663 pool = &cache->small;
666 pool = &cache->large;
669 STAILQ_FOREACH(e, pool->queue, stailq) {
671 STAILQ_REMOVE(pool->queue, entry, spdk_iobuf_entry, stailq);
697 struct spdk_iobuf_pool_cache *pool;
704 pool = &cache->small;
707 pool = &cache->large;
710 buf = (void *)STAILQ_FIRST(&pool->cache);
712 STAILQ_REMOVE_HEAD(&pool->cache, stailq);
713 assert(pool->cache_count > 0);
714 pool->cache_count--;
715 pool->stats.cache++;
721 sz = spdk_ring_dequeue(pool->pool, (void **)bufs, spdk_min(IOBUF_BATCH_SIZE,
722 spdk_max(pool->cache_size, 1)));
725 STAILQ_INSERT_TAIL(pool->queue, entry, stailq);
728 pool->stats.retry++;
734 pool->stats.main++;
736 STAILQ_INSERT_HEAD(&pool->cache, bufs[i], stailq);
737 pool->cache_count++;
753 struct spdk_iobuf_pool_cache *pool;
767 pool = &cache->small;
769 pool = &cache->large;
772 if (STAILQ_EMPTY(pool->queue)) {
773 if (pool->cache_size == 0) {
774 spdk_ring_enqueue(pool->pool, (void **)&buf, 1, NULL);
780 STAILQ_INSERT_HEAD(&pool->cache, iobuf_buf, stailq);
781 pool->cache_count++;
784 * central pool in batches of known size, so wait until at least a batch
785 * has been returned to actually return the buffers to the central pool. */
786 sz = spdk_min(IOBUF_BATCH_SIZE, pool->cache_size);
787 if (pool->cache_count >= pool->cache_size + sz) {
792 bufs[i] = STAILQ_FIRST(&pool->cache);
793 STAILQ_REMOVE_HEAD(&pool->cache, stailq);
794 assert(pool->cache_count > 0);
795 pool->cache_count--;
798 spdk_ring_enqueue(pool->pool, (void **)bufs, sz, NULL);
801 entry = STAILQ_FIRST(pool->queue);
802 STAILQ_REMOVE_HEAD(pool->queue, stailq);
804 if (spdk_unlikely(entry == STAILQ_LAST(pool->queue, spdk_iobuf_entry, stailq))) {
805 STAILQ_REMOVE(pool->queue, entry, spdk_iobuf_entry, stailq);
806 STAILQ_INSERT_HEAD(pool->queue, entry, stailq);