Lines Matching defs:cache

88 static void rds_ib_cache_xfer_to_ready(struct rds_ib_refill_cache *cache)
92 tmp = xchg(&cache->xfer, NULL);
94 if (cache->ready)
95 list_splice_entire_tail(tmp, cache->ready);
97 cache->ready = tmp;
101 static int rds_ib_recv_alloc_cache(struct rds_ib_refill_cache *cache, gfp_t gfp)
106 cache->percpu = alloc_percpu_gfp(struct rds_ib_cache_head, gfp);
107 if (!cache->percpu)
111 head = per_cpu_ptr(cache->percpu, cpu);
115 cache->xfer = NULL;
116 cache->ready = NULL;
135 static void rds_ib_cache_splice_all_lists(struct rds_ib_refill_cache *cache,
142 head = per_cpu_ptr(cache->percpu, cpu);
149 if (cache->ready) {
150 list_splice_entire_tail(cache->ready, caller_list);
151 cache->ready = NULL;
187 struct rds_ib_refill_cache *cache);
188 static struct list_head *rds_ib_recv_cache_get(struct rds_ib_refill_cache *cache);
468 * the recyclee, as well as the cache to put it on.
479 struct rds_ib_refill_cache *cache)
486 chpfirst = __this_cpu_read(cache->percpu->first);
492 __this_cpu_write(cache->percpu->first, new_item);
493 __this_cpu_inc(cache->percpu->count);
495 if (__this_cpu_read(cache->percpu->count) < RDS_IB_RECYCLE_BATCH_COUNT)
499 * Return our per-cpu first list to the cache's xfer by atomically
502 * cache's xfer list as long as it's still empty.
505 old = xchg(&cache->xfer, NULL);
508 old = cmpxchg(&cache->xfer, NULL, chpfirst);
512 __this_cpu_write(cache->percpu->first, NULL);
513 __this_cpu_write(cache->percpu->count, 0);
518 static struct list_head *rds_ib_recv_cache_get(struct rds_ib_refill_cache *cache)
520 struct list_head *head = cache->ready;
524 cache->ready = head->next;
527 cache->ready = NULL;