Lines Matching defs:cache

89 static void rds_ib_cache_xfer_to_ready(struct rds_ib_refill_cache *cache)
93 tmp = xchg(&cache->xfer, NULL);
95 if (cache->ready)
96 list_splice_entire_tail(tmp, cache->ready);
98 cache->ready = tmp;
102 static int rds_ib_recv_alloc_cache(struct rds_ib_refill_cache *cache, gfp_t gfp)
107 cache->percpu = alloc_percpu_gfp(struct rds_ib_cache_head, gfp);
108 if (!cache->percpu)
112 head = per_cpu_ptr(cache->percpu, cpu);
116 cache->xfer = NULL;
117 cache->ready = NULL;
136 static void rds_ib_cache_splice_all_lists(struct rds_ib_refill_cache *cache,
143 head = per_cpu_ptr(cache->percpu, cpu);
150 if (cache->ready) {
151 list_splice_entire_tail(cache->ready, caller_list);
152 cache->ready = NULL;
188 struct rds_ib_refill_cache *cache);
189 static struct list_head *rds_ib_recv_cache_get(struct rds_ib_refill_cache *cache);
469 * the recyclee, as well as the cache to put it on.
480 struct rds_ib_refill_cache *cache)
487 chpfirst = __this_cpu_read(cache->percpu->first);
493 __this_cpu_write(cache->percpu->first, new_item);
494 __this_cpu_inc(cache->percpu->count);
496 if (__this_cpu_read(cache->percpu->count) < RDS_IB_RECYCLE_BATCH_COUNT)
500 * Return our per-cpu first list to the cache's xfer by atomically
503 * cache's xfer list as long as it's still empty.
506 old = xchg(&cache->xfer, NULL);
509 old = cmpxchg(&cache->xfer, NULL, chpfirst);
513 __this_cpu_write(cache->percpu->first, NULL);
514 __this_cpu_write(cache->percpu->count, 0);
519 static struct list_head *rds_ib_recv_cache_get(struct rds_ib_refill_cache *cache)
521 struct list_head *head = cache->ready;
525 cache->ready = head->next;
528 cache->ready = NULL;