Lines Matching refs:rcache

402  * alloc_iova_fast - allocates an iova from rcache
406 * @flush_rcache: - set to flush rcache on regular allocation failure
407 * This function tries to satisfy an iova allocation from the rcache,
409 * fails too and the flush_rcache flag is set then the rcache will be flushed.
430 /* Try replenishing IOVAs by flushing rcache. */
442 * free_iova_fast - free iova pfn range into rcache
446 * This functions frees an iova range by trying to put it into the rcache,
865 struct iova_rcache *rcache;
870 rcache = &iovad->rcaches[i];
871 spin_lock_init(&rcache->lock);
872 rcache->depot_size = 0;
873 rcache->cpu_rcaches = __alloc_percpu(sizeof(*cpu_rcache), cache_line_size());
874 if (WARN_ON(!rcache->cpu_rcaches))
877 cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu);
886 * Try inserting IOVA range starting with 'iova_pfn' into 'rcache', and
887 * return true on success. Can fail if rcache is full and we can't free
892 struct iova_rcache *rcache,
900 cpu_rcache = raw_cpu_ptr(rcache->cpu_rcaches);
912 spin_lock(&rcache->lock);
913 if (rcache->depot_size < MAX_GLOBAL_MAGS) {
914 rcache->depot[rcache->depot_size++] =
919 spin_unlock(&rcache->lock);
951 * Caller wants to allocate a new IOVA range from 'rcache'. If we can
953 * it from the 'rcache'.
955 static unsigned long __iova_rcache_get(struct iova_rcache *rcache,
963 cpu_rcache = raw_cpu_ptr(rcache->cpu_rcaches);
972 spin_lock(&rcache->lock);
973 if (rcache->depot_size > 0) {
975 cpu_rcache->loaded = rcache->depot[--rcache->depot_size];
978 spin_unlock(&rcache->lock);
990 * Try to satisfy IOVA allocation range from rcache. Fail if requested
1007 * free rcache data structures.
1011 struct iova_rcache *rcache;
1017 rcache = &iovad->rcaches[i];
1019 cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu);
1023 free_percpu(rcache->cpu_rcaches);
1024 for (j = 0; j < rcache->depot_size; ++j)
1025 iova_magazine_free(rcache->depot[j]);
1035 struct iova_rcache *rcache;
1040 rcache = &iovad->rcaches[i];
1041 cpu_rcache = per_cpu_ptr(rcache->cpu_rcaches, cpu);