Lines Matching refs:pool

14 bucket_for_size(struct intel_gt_buffer_pool *pool, size_t sz)
24 if (n >= ARRAY_SIZE(pool->cache_list))
25 n = ARRAY_SIZE(pool->cache_list) - 1;
27 return &pool->cache_list[n];
37 static bool pool_free_older_than(struct intel_gt_buffer_pool *pool, long keep)
44 for (n = 0; n < ARRAY_SIZE(pool->cache_list); n++) {
45 struct list_head *list = &pool->cache_list[n];
50 if (spin_trylock_irq(&pool->lock)) {
73 spin_unlock_irq(&pool->lock);
89 struct intel_gt_buffer_pool *pool =
90 container_of(wrk, typeof(*pool), work.work);
91 struct intel_gt *gt = container_of(pool, struct intel_gt, buffer_pool);
93 if (pool_free_older_than(pool, HZ))
94 queue_delayed_work(gt->i915->unordered_wq, &pool->work,
102 struct intel_gt_buffer_pool *pool = node->pool;
103 struct intel_gt *gt = container_of(pool, struct intel_gt, buffer_pool);
104 struct list_head *list = bucket_for_size(pool, node->obj->base.size);
110 /* Return this object to the shrinker pool */
116 spin_lock_irqsave(&pool->lock, flags);
119 spin_unlock_irqrestore(&pool->lock, flags);
121 queue_delayed_work(gt->i915->unordered_wq, &pool->work,
139 node_create(struct intel_gt_buffer_pool *pool, size_t sz,
142 struct intel_gt *gt = container_of(pool, struct intel_gt, buffer_pool);
152 node->pool = pool;
174 struct intel_gt_buffer_pool *pool = &gt->buffer_pool;
180 list = bucket_for_size(pool, size);
197 spin_lock_irq(&pool->lock);
199 spin_unlock_irq(&pool->lock);
206 node = node_create(pool, size, type);
222 struct intel_gt_buffer_pool *pool = &gt->buffer_pool;
225 spin_lock_init(&pool->lock);
226 for (n = 0; n < ARRAY_SIZE(pool->cache_list); n++)
227 INIT_LIST_HEAD(&pool->cache_list[n]);
228 INIT_DELAYED_WORK(&pool->work, pool_free_work);
233 struct intel_gt_buffer_pool *pool = &gt->buffer_pool;
236 while (pool_free_older_than(pool, 0))
238 } while (cancel_delayed_work_sync(&pool->work));
243 struct intel_gt_buffer_pool *pool = &gt->buffer_pool;
246 for (n = 0; n < ARRAY_SIZE(pool->cache_list); n++)
247 GEM_BUG_ON(!list_empty(&pool->cache_list[n]));