Lines Matching refs:cache

118 #define	RTL_CACHE_HASH_INDEX(cache, addr) \  argument
119 …RTL_CACHE_HASH_INDEX_IMPL((addr), (cache)->m_hash_shift, (cache)->m_type_shift, ((cache)->m_hash_s…
126 rtl_cache_type * cache, in rtl_cache_hash_rescale() argument
143 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_slab_lock)); in rtl_cache_hash_rescale()
145 old_table = cache->m_hash_table; in rtl_cache_hash_rescale()
146 old_size = cache->m_hash_size; in rtl_cache_hash_rescale()
152 cache->m_name, in rtl_cache_hash_rescale()
153 cache->m_slab_stats.m_alloc - cache->m_slab_stats.m_free, in rtl_cache_hash_rescale()
154 (cache->m_slab_stats.m_alloc - cache->m_slab_stats.m_free) >> cache->m_hash_shift, in rtl_cache_hash_rescale()
155 cache->m_slab_stats.m_free, in rtl_cache_hash_rescale()
158 cache->m_hash_table = new_table; in rtl_cache_hash_rescale()
159 cache->m_hash_size = new_size; in rtl_cache_hash_rescale()
160 cache->m_hash_shift = highbit(cache->m_hash_size) - 1; in rtl_cache_hash_rescale()
170 head = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, curr->m_addr)]); in rtl_cache_hash_rescale()
179 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock)); in rtl_cache_hash_rescale()
181 if (old_table != cache->m_hash_table_0) in rtl_cache_hash_rescale()
193 rtl_cache_type * cache, in rtl_cache_hash_insert() argument
199 ppHead = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, bufctl->m_addr)]); in rtl_cache_hash_insert()
216 rtl_cache_type * cache, in rtl_cache_hash_remove() argument
224 ppHead = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, addr)]); in rtl_cache_hash_remove()
241 sal_Size nbuf = (sal_Size)(cache->m_slab_stats.m_alloc - cache->m_slab_stats.m_free); in rtl_cache_hash_remove()
242 if (nbuf > 4 * cache->m_hash_size) in rtl_cache_hash_remove()
244 if (!(cache->m_features & RTL_CACHE_FEATURE_RESCALE)) in rtl_cache_hash_remove()
246 sal_Size ave = nbuf >> cache->m_hash_shift; in rtl_cache_hash_remove()
247 sal_Size new_size = cache->m_hash_size << (highbit(ave) - 1); in rtl_cache_hash_remove()
249 cache->m_features |= RTL_CACHE_FEATURE_RESCALE; in rtl_cache_hash_remove()
250 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock)); in rtl_cache_hash_remove()
251 rtl_cache_hash_rescale (cache, new_size); in rtl_cache_hash_remove()
252 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_slab_lock)); in rtl_cache_hash_remove()
253 cache->m_features &= ~RTL_CACHE_FEATURE_RESCALE; in rtl_cache_hash_remove()
312 rtl_cache_type * cache in rtl_cache_slab_create() argument
319 size = cache->m_slab_size; in rtl_cache_slab_create()
320 addr = rtl_arena_alloc (cache->m_source, &size); in rtl_cache_slab_create()
323 OSL_ASSERT(size >= cache->m_slab_size); in rtl_cache_slab_create()
325 if (cache->m_features & RTL_CACHE_FEATURE_HASH) in rtl_cache_slab_create()
328 OSL_ASSERT (cache != gp_cache_slab_cache); in rtl_cache_slab_create()
334 slab = RTL_CACHE_SLAB(addr, cache->m_slab_size); in rtl_cache_slab_create()
347 rtl_arena_free (cache->m_source, addr, size); in rtl_cache_slab_create()
360 rtl_cache_type * cache, in rtl_cache_slab_destroy() argument
367 if (cache->m_features & RTL_CACHE_FEATURE_HASH) in rtl_cache_slab_destroy()
370 sal_Size ntypes = (slab->m_bp - slab->m_data) / cache->m_type_size; in rtl_cache_slab_destroy()
392 if ((refcnt == 0) || (cache->m_features & RTL_CACHE_FEATURE_BULKDESTROY)) in rtl_cache_slab_destroy()
395 rtl_arena_free (cache->m_source, addr, cache->m_slab_size); in rtl_cache_slab_destroy()
406 rtl_cache_type * cache in rtl_cache_slab_populate() argument
411 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock)); in rtl_cache_slab_populate()
412 slab = rtl_cache_slab_create (cache); in rtl_cache_slab_populate()
413 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_slab_lock)); in rtl_cache_slab_populate()
417 slab->m_bp += cache->m_ncolor; in rtl_cache_slab_populate()
420 cache->m_ncolor += cache->m_type_align; in rtl_cache_slab_populate()
421 if (cache->m_ncolor > cache->m_ncolor_max) in rtl_cache_slab_populate()
422 cache->m_ncolor = 0; in rtl_cache_slab_populate()
425 cache->m_slab_stats.m_mem_total += cache->m_slab_size; in rtl_cache_slab_populate()
428 QUEUE_INSERT_HEAD_NAMED(&(cache->m_free_head), slab, slab_); in rtl_cache_slab_populate()
441 rtl_cache_type * cache in rtl_cache_slab_alloc() argument
447 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_slab_lock)); in rtl_cache_slab_alloc()
449 head = &(cache->m_free_head); in rtl_cache_slab_alloc()
450 if ((head->m_slab_next != head) || rtl_cache_slab_populate (cache)) in rtl_cache_slab_alloc()
456 OSL_ASSERT(slab->m_ntypes < cache->m_ntypes); in rtl_cache_slab_alloc()
461 …OSL_ASSERT (slab->m_bp < slab->m_data + cache->m_ntypes * cache->m_type_size + cache->m_ncolor_max… in rtl_cache_slab_alloc()
462 if (cache->m_features & RTL_CACHE_FEATURE_HASH) in rtl_cache_slab_alloc()
465 OSL_ASSERT (cache != gp_cache_bufctl_cache); in rtl_cache_slab_alloc()
470 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock)); in rtl_cache_slab_alloc()
485 slab->m_bp += cache->m_type_size; in rtl_cache_slab_alloc()
496 if ((slab->m_ntypes += 1) == cache->m_ntypes) in rtl_cache_slab_alloc()
502 QUEUE_INSERT_TAIL_NAMED(&(cache->m_used_head), slab, slab_); in rtl_cache_slab_alloc()
506 cache->m_slab_stats.m_alloc += 1; in rtl_cache_slab_alloc()
507 cache->m_slab_stats.m_mem_alloc += cache->m_type_size; in rtl_cache_slab_alloc()
509 if (cache->m_features & RTL_CACHE_FEATURE_HASH) in rtl_cache_slab_alloc()
510 addr = (void*)rtl_cache_hash_insert (cache, bufctl); in rtl_cache_slab_alloc()
515 OSL_DEBUG_ONLY(memset(addr, 0x77777777, cache->m_type_size)); in rtl_cache_slab_alloc()
516 VALGRIND_MEMPOOL_ALLOC(cache, addr, cache->m_type_size); in rtl_cache_slab_alloc()
519 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock)); in rtl_cache_slab_alloc()
530 rtl_cache_type * cache, in rtl_cache_slab_free() argument
537 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_slab_lock)); in rtl_cache_slab_free()
540 VALGRIND_MEMPOOL_FREE(cache, addr); in rtl_cache_slab_free()
541 /* OSL_DEBUG_ONLY() */ VALGRIND_MAKE_MEM_UNDEFINED(addr, cache->m_type_size); in rtl_cache_slab_free()
542 OSL_DEBUG_ONLY(memset(addr, 0x33333333, cache->m_type_size)); in rtl_cache_slab_free()
545 if (cache->m_features & RTL_CACHE_FEATURE_HASH) in rtl_cache_slab_free()
547 bufctl = rtl_cache_hash_remove (cache, (sal_uIntPtr)(addr)); in rtl_cache_slab_free()
554 slab = RTL_CACHE_SLAB(addr, cache->m_slab_size); in rtl_cache_slab_free()
560 if (slab->m_ntypes == cache->m_ntypes) in rtl_cache_slab_free()
566 QUEUE_INSERT_HEAD_NAMED(&(cache->m_free_head), slab, slab_); in rtl_cache_slab_free()
574 cache->m_slab_stats.m_free += 1; in rtl_cache_slab_free()
575 cache->m_slab_stats.m_mem_alloc -= cache->m_type_size; in rtl_cache_slab_free()
584 cache->m_slab_stats.m_mem_total -= cache->m_slab_size; in rtl_cache_slab_free()
587 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock)); in rtl_cache_slab_free()
588 rtl_cache_slab_destroy (cache, slab); in rtl_cache_slab_free()
593 RTL_MEMORY_LOCK_RELEASE(&(cache->m_slab_lock)); in rtl_cache_slab_free()
641 rtl_cache_type * cache, in rtl_cache_magazine_clear() argument
651 VALGRIND_MEMPOOL_ALLOC(cache, obj, cache->m_type_size); in rtl_cache_magazine_clear()
652 if (cache->m_destructor != 0) in rtl_cache_magazine_clear()
655 VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size); in rtl_cache_magazine_clear()
658 (cache->m_destructor)(obj, cache->m_userarg); in rtl_cache_magazine_clear()
662 rtl_cache_slab_free (cache, obj); in rtl_cache_magazine_clear()
728 rtl_cache_type * cache, in rtl_cache_depot_exchange_alloc() argument
737 full = rtl_cache_depot_dequeue (&(cache->m_depot_full)); in rtl_cache_depot_exchange_alloc()
741 rtl_cache_depot_enqueue (&(cache->m_depot_empty), empty); in rtl_cache_depot_exchange_alloc()
760 rtl_cache_type * cache, in rtl_cache_depot_exchange_free() argument
769 empty = rtl_cache_depot_dequeue (&(cache->m_depot_empty)); in rtl_cache_depot_exchange_free()
773 rtl_cache_depot_enqueue (&(cache->m_depot_full), full); in rtl_cache_depot_exchange_free()
792 rtl_cache_type * cache in rtl_cache_depot_populate() argument
797 if (cache->m_magazine_cache != 0) in rtl_cache_depot_populate()
800 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock)); in rtl_cache_depot_populate()
801 empty = (rtl_cache_magazine_type*)rtl_cache_alloc (cache->m_magazine_cache); in rtl_cache_depot_populate()
802 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock)); in rtl_cache_depot_populate()
806 rtl_cache_depot_enqueue (&(cache->m_depot_empty), empty); in rtl_cache_depot_populate()
819 rtl_cache_type * cache = (rtl_cache_type*)(obj); in rtl_cache_constructor() local
821 memset (cache, 0, sizeof(rtl_cache_type)); in rtl_cache_constructor()
824 QUEUE_START_NAMED(cache, cache_); in rtl_cache_constructor()
827 (void)RTL_MEMORY_LOCK_INIT(&(cache->m_slab_lock)); in rtl_cache_constructor()
829 QUEUE_START_NAMED(&(cache->m_free_head), slab_); in rtl_cache_constructor()
830 QUEUE_START_NAMED(&(cache->m_used_head), slab_); in rtl_cache_constructor()
832 cache->m_hash_table = cache->m_hash_table_0; in rtl_cache_constructor()
833 cache->m_hash_size = RTL_CACHE_HASH_SIZE; in rtl_cache_constructor()
834 cache->m_hash_shift = highbit(cache->m_hash_size) - 1; in rtl_cache_constructor()
837 (void)RTL_MEMORY_LOCK_INIT(&(cache->m_depot_lock)); in rtl_cache_constructor()
847 rtl_cache_type * cache = (rtl_cache_type*)(obj); in rtl_cache_destructor() local
850 OSL_ASSERT(QUEUE_STARTED_NAMED(cache, cache_)); in rtl_cache_destructor()
853 (void)RTL_MEMORY_LOCK_DESTROY(&(cache->m_slab_lock)); in rtl_cache_destructor()
855 OSL_ASSERT(QUEUE_STARTED_NAMED(&(cache->m_free_head), slab_)); in rtl_cache_destructor()
856 OSL_ASSERT(QUEUE_STARTED_NAMED(&(cache->m_used_head), slab_)); in rtl_cache_destructor()
858 OSL_ASSERT(cache->m_hash_table == cache->m_hash_table_0); in rtl_cache_destructor()
859 OSL_ASSERT(cache->m_hash_size == RTL_CACHE_HASH_SIZE); in rtl_cache_destructor()
860 OSL_ASSERT(cache->m_hash_shift == (sal_Size)(highbit(cache->m_hash_size) - 1)); in rtl_cache_destructor()
863 (void)RTL_MEMORY_LOCK_DESTROY(&(cache->m_depot_lock)); in rtl_cache_destructor()
872 rtl_cache_type * cache, in rtl_cache_activate() argument
884 OSL_ASSERT(cache != 0); in rtl_cache_activate()
885 if (cache != 0) in rtl_cache_activate()
889 snprintf (cache->m_name, sizeof(cache->m_name), "%s", name); in rtl_cache_activate()
909 cache->m_type_size = objsize = RTL_MEMORY_P2ROUNDUP(objsize, objalign); in rtl_cache_activate()
910 cache->m_type_align = objalign; in rtl_cache_activate()
911 cache->m_type_shift = highbit(cache->m_type_size) - 1; in rtl_cache_activate()
913 cache->m_constructor = constructor; in rtl_cache_activate()
914 cache->m_destructor = destructor; in rtl_cache_activate()
915 cache->m_reclaim = reclaim; in rtl_cache_activate()
916 cache->m_userarg = userarg; in rtl_cache_activate()
919 cache->m_source = source; in rtl_cache_activate()
930 slabsize = SAL_MAX(slabsize, cache->m_type_size * 8); in rtl_cache_activate()
936 cache->m_slab_size = slabsize; in rtl_cache_activate()
938 if (cache->m_slab_size > source->m_quantum) in rtl_cache_activate()
943 cache->m_features |= RTL_CACHE_FEATURE_HASH; in rtl_cache_activate()
944 cache->m_ntypes = cache->m_slab_size / cache->m_type_size; in rtl_cache_activate()
945 cache->m_ncolor_max = cache->m_slab_size % cache->m_type_size; in rtl_cache_activate()
950 cache->m_ntypes = (cache->m_slab_size - sizeof(rtl_cache_slab_type)) / cache->m_type_size; in rtl_cache_activate()
951 cache->m_ncolor_max = (cache->m_slab_size - sizeof(rtl_cache_slab_type)) % cache->m_type_size; in rtl_cache_activate()
954 OSL_ASSERT(cache->m_ntypes > 0); in rtl_cache_activate()
955 cache->m_ncolor = 0; in rtl_cache_activate()
960 cache->m_features |= RTL_CACHE_FEATURE_BULKDESTROY; in rtl_cache_activate()
967 cache->m_magazine_cache = gp_cache_magazine_cache; in rtl_cache_activate()
972 QUEUE_INSERT_TAIL_NAMED(&(g_cache_list.m_cache_head), cache, cache_); in rtl_cache_activate()
975 return (cache); in rtl_cache_activate()
982 rtl_cache_type * cache in rtl_cache_deactivate() argument
989 active = QUEUE_STARTED_NAMED(cache, cache_) == 0; in rtl_cache_deactivate()
990 QUEUE_REMOVE_NAMED(cache, cache_); in rtl_cache_deactivate()
996 if (cache->m_magazine_cache != 0) in rtl_cache_deactivate()
1002 mag_cache = cache->m_magazine_cache, cache->m_magazine_cache = 0; in rtl_cache_deactivate()
1005 if ((mag = cache->m_cpu_curr) != 0) in rtl_cache_deactivate()
1007 cache->m_cpu_curr = 0; in rtl_cache_deactivate()
1008 rtl_cache_magazine_clear (cache, mag); in rtl_cache_deactivate()
1011 if ((mag = cache->m_cpu_prev) != 0) in rtl_cache_deactivate()
1013 cache->m_cpu_prev = 0; in rtl_cache_deactivate()
1014 rtl_cache_magazine_clear (cache, mag); in rtl_cache_deactivate()
1019 while ((mag = rtl_cache_depot_dequeue(&(cache->m_depot_full))) != 0) in rtl_cache_deactivate()
1021 rtl_cache_magazine_clear (cache, mag); in rtl_cache_deactivate()
1024 while ((mag = rtl_cache_depot_dequeue(&(cache->m_depot_empty))) != 0) in rtl_cache_deactivate()
1026 rtl_cache_magazine_clear (cache, mag); in rtl_cache_deactivate()
1036 cache->m_name, in rtl_cache_deactivate()
1037 cache->m_slab_stats.m_alloc, cache->m_slab_stats.m_free, in rtl_cache_deactivate()
1038 cache->m_slab_stats.m_mem_total, cache->m_slab_stats.m_mem_alloc, in rtl_cache_deactivate()
1039 cache->m_cpu_stats.m_alloc, cache->m_cpu_stats.m_free, in rtl_cache_deactivate()
1040 cache->m_slab_stats.m_alloc + cache->m_cpu_stats.m_alloc, in rtl_cache_deactivate()
1041 cache->m_slab_stats.m_free + cache->m_cpu_stats.m_free in rtl_cache_deactivate()
1045 if (cache->m_slab_stats.m_alloc > cache->m_slab_stats.m_free) in rtl_cache_deactivate()
1050 cache->m_name, in rtl_cache_deactivate()
1051 cache->m_slab_stats.m_alloc - cache->m_slab_stats.m_free, in rtl_cache_deactivate()
1052 cache->m_slab_stats.m_mem_alloc, cache->m_slab_stats.m_mem_total in rtl_cache_deactivate()
1055 if (cache->m_features & RTL_CACHE_FEATURE_HASH) in rtl_cache_deactivate()
1058 sal_Size i, n = cache->m_hash_size; in rtl_cache_deactivate()
1062 while ((bufctl = cache->m_hash_table[i]) != 0) in rtl_cache_deactivate()
1065 cache->m_hash_table[i] = bufctl->m_next, bufctl->m_next = 0; in rtl_cache_deactivate()
1076 head = &(cache->m_used_head); in rtl_cache_deactivate()
1083 cache->m_slab_stats.m_mem_total -= cache->m_slab_size; in rtl_cache_deactivate()
1086 rtl_cache_slab_destroy (cache, slab); in rtl_cache_deactivate()
1089 head = &(cache->m_free_head); in rtl_cache_deactivate()
1096 cache->m_slab_stats.m_mem_total -= cache->m_slab_size; in rtl_cache_deactivate()
1099 rtl_cache_slab_destroy (cache, slab); in rtl_cache_deactivate()
1104 if (cache->m_hash_table != cache->m_hash_table_0) in rtl_cache_deactivate()
1108 cache->m_hash_table, in rtl_cache_deactivate()
1109 cache->m_hash_size * sizeof(rtl_cache_bufctl_type*)); in rtl_cache_deactivate()
1111 cache->m_hash_table = cache->m_hash_table_0; in rtl_cache_deactivate()
1112 cache->m_hash_size = RTL_CACHE_HASH_SIZE; in rtl_cache_deactivate()
1113 cache->m_hash_shift = highbit(cache->m_hash_size) - 1; in rtl_cache_deactivate()
1145 rtl_cache_type * cache = result; in rtl_cache_create() local
1146 VALGRIND_CREATE_MEMPOOL(cache, 0, 0); in rtl_cache_create()
1147 (void) rtl_cache_constructor (cache); in rtl_cache_create()
1157 cache, in rtl_cache_create()
1172 rtl_cache_deactivate (cache); in rtl_cache_create()
1173 rtl_cache_destructor (cache); in rtl_cache_create()
1174 VALGRIND_DESTROY_MEMPOOL(cache); in rtl_cache_create()
1175 rtl_arena_free (gp_cache_arena, cache, size); in rtl_cache_create()
1192 rtl_cache_type * cache in rtl_cache_destroy() argument
1195 if (cache != 0) in rtl_cache_destroy()
1197 rtl_cache_deactivate (cache); in rtl_cache_destroy()
1198 rtl_cache_destructor (cache); in rtl_cache_destroy()
1199 VALGRIND_DESTROY_MEMPOOL(cache); in rtl_cache_destroy()
1200 rtl_arena_free (gp_cache_arena, cache, sizeof(rtl_cache_type)); in rtl_cache_destroy()
1208 rtl_cache_type * cache in rtl_cache_alloc() argument
1213 if (cache == 0) in rtl_cache_alloc()
1216 if (cache->m_cpu_curr != 0) in rtl_cache_alloc()
1218 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock)); in rtl_cache_alloc()
1225 curr = cache->m_cpu_curr; in rtl_cache_alloc()
1230 VALGRIND_MEMPOOL_ALLOC(cache, obj, cache->m_type_size); in rtl_cache_alloc()
1231 if (cache->m_constructor != 0) in rtl_cache_alloc()
1234 VALGRIND_MAKE_MEM_DEFINED(obj, cache->m_type_size); in rtl_cache_alloc()
1237 cache->m_cpu_stats.m_alloc += 1; in rtl_cache_alloc()
1238 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock)); in rtl_cache_alloc()
1243 prev = cache->m_cpu_prev; in rtl_cache_alloc()
1246 temp = cache->m_cpu_curr; in rtl_cache_alloc()
1247 cache->m_cpu_curr = cache->m_cpu_prev; in rtl_cache_alloc()
1248 cache->m_cpu_prev = temp; in rtl_cache_alloc()
1253 temp = rtl_cache_depot_exchange_alloc (cache, prev); in rtl_cache_alloc()
1256 cache->m_cpu_prev = cache->m_cpu_curr; in rtl_cache_alloc()
1257 cache->m_cpu_curr = temp; in rtl_cache_alloc()
1266 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock)); in rtl_cache_alloc()
1270 obj = rtl_cache_slab_alloc (cache); in rtl_cache_alloc()
1271 if ((obj != 0) && (cache->m_constructor != 0)) in rtl_cache_alloc()
1274 if (!((cache->m_constructor)(obj, cache->m_userarg))) in rtl_cache_alloc()
1277 rtl_cache_slab_free (cache, obj), obj = 0; in rtl_cache_alloc()
1287 rtl_cache_type * cache, in rtl_cache_free() argument
1291 if ((obj != 0) && (cache != 0)) in rtl_cache_free()
1293 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock)); in rtl_cache_free()
1300 curr = cache->m_cpu_curr; in rtl_cache_free()
1305 VALGRIND_MEMPOOL_FREE(cache, obj); in rtl_cache_free()
1307 cache->m_cpu_stats.m_free += 1; in rtl_cache_free()
1308 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock)); in rtl_cache_free()
1313 prev = cache->m_cpu_prev; in rtl_cache_free()
1316 temp = cache->m_cpu_curr; in rtl_cache_free()
1317 cache->m_cpu_curr = cache->m_cpu_prev; in rtl_cache_free()
1318 cache->m_cpu_prev = temp; in rtl_cache_free()
1323 temp = rtl_cache_depot_exchange_free (cache, prev); in rtl_cache_free()
1326 cache->m_cpu_prev = cache->m_cpu_curr; in rtl_cache_free()
1327 cache->m_cpu_curr = temp; in rtl_cache_free()
1332 if (rtl_cache_depot_populate(cache) != 0) in rtl_cache_free()
1341 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock)); in rtl_cache_free()
1344 if (cache->m_destructor != 0) in rtl_cache_free()
1347 (cache->m_destructor)(obj, cache->m_userarg); in rtl_cache_free()
1351 rtl_cache_slab_free (cache, obj); in rtl_cache_free()
1549 rtl_cache_type * cache, in rtl_cache_depot_wsupdate() argument
1564 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock)); in rtl_cache_depot_wsupdate()
1565 rtl_cache_magazine_clear (cache, mag); in rtl_cache_depot_wsupdate()
1566 rtl_cache_free (cache->m_magazine_cache, mag); in rtl_cache_depot_wsupdate()
1567 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock)); in rtl_cache_depot_wsupdate()
1578 rtl_cache_type * cache in rtl_cache_wsupdate() argument
1581 if (cache->m_magazine_cache != 0) in rtl_cache_wsupdate()
1583 RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock)); in rtl_cache_wsupdate()
1589 cache->m_name, in rtl_cache_wsupdate()
1590 cache->m_depot_full.m_mag_count, in rtl_cache_wsupdate()
1591 cache->m_depot_full.m_curr_min, in rtl_cache_wsupdate()
1592 cache->m_depot_full.m_prev_min, in rtl_cache_wsupdate()
1593 cache->m_depot_empty.m_mag_count, in rtl_cache_wsupdate()
1594 cache->m_depot_empty.m_curr_min, in rtl_cache_wsupdate()
1595 cache->m_depot_empty.m_prev_min in rtl_cache_wsupdate()
1598 rtl_cache_depot_wsupdate (cache, &(cache->m_depot_full)); in rtl_cache_wsupdate()
1599 rtl_cache_depot_wsupdate (cache, &(cache->m_depot_empty)); in rtl_cache_wsupdate()
1601 RTL_MEMORY_LOCK_RELEASE(&(cache->m_depot_lock)); in rtl_cache_wsupdate()
1625 rtl_cache_type * head, * cache; in rtl_cache_wsupdate_all() local
1628 for (cache = head->m_cache_next; in rtl_cache_wsupdate_all()
1629 cache != head; in rtl_cache_wsupdate_all()
1630 cache = cache->m_cache_next) in rtl_cache_wsupdate_all()
1632 rtl_cache_wsupdate (cache); in rtl_cache_wsupdate_all()
1781 rtl_cache_type * cache, * head; in rtl_cache_fini() local
1787 cache = gp_cache_bufctl_cache, gp_cache_bufctl_cache = 0; in rtl_cache_fini()
1788 rtl_cache_deactivate (cache); in rtl_cache_fini()
1789 rtl_cache_destructor (cache); in rtl_cache_fini()
1790 VALGRIND_DESTROY_MEMPOOL(cache); in rtl_cache_fini()
1794 cache = gp_cache_slab_cache, gp_cache_slab_cache = 0; in rtl_cache_fini()
1795 rtl_cache_deactivate (cache); in rtl_cache_fini()
1796 rtl_cache_destructor (cache); in rtl_cache_fini()
1797 VALGRIND_DESTROY_MEMPOOL(cache); in rtl_cache_fini()
1801 cache = gp_cache_magazine_cache, gp_cache_magazine_cache = 0; in rtl_cache_fini()
1802 rtl_cache_deactivate (cache); in rtl_cache_fini()
1803 rtl_cache_destructor (cache); in rtl_cache_fini()
1804 VALGRIND_DESTROY_MEMPOOL(cache); in rtl_cache_fini()
1814 for (cache = head->m_cache_next; cache != head; cache = cache->m_cache_next) in rtl_cache_fini()
1821 cache->m_name, in rtl_cache_fini()
1822 cache->m_slab_stats.m_alloc, cache->m_slab_stats.m_free, in rtl_cache_fini()
1823 cache->m_slab_stats.m_mem_total, cache->m_slab_stats.m_mem_alloc, in rtl_cache_fini()
1824 cache->m_cpu_stats.m_alloc, cache->m_cpu_stats.m_free, in rtl_cache_fini()
1825 cache->m_slab_stats.m_alloc + cache->m_cpu_stats.m_alloc, in rtl_cache_fini()
1826 cache->m_slab_stats.m_free + cache->m_cpu_stats.m_free in rtl_cache_fini()