MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zone_free_item

Function zone_free_item

freebsd/vm/uma_core.c:4574–4601  ·  view source on GitHub ↗

* Frees a single item to any zone. * * Arguments: * zone The zone to free to * item The item we're freeing * udata User supplied data for the dtor * skip Skip dtors and finis */

Source from the content-addressed store, hash-verified

4572 * skip Skip dtors and finis
4573 */
4574static __noinline void
4575zone_free_item(uma_zone_t zone, void *item, void *udata, enum zfreeskip skip)
4576{
4577
4578 /*
4579 * If a free is sent directly to an SMR zone we have to
4580 * synchronize immediately because the item can instantly
4581 * be reallocated. This should only happen in degenerate
4582 * cases when no memory is available for per-cpu caches.
4583 */
4584 if ((zone->uz_flags & UMA_ZONE_SMR) != 0 && skip == SKIP_NONE)
4585 smr_synchronize(zone->uz_smr);
4586
4587 item_dtor(zone, item, zone->uz_size, udata, skip);
4588
4589 if (skip < SKIP_FINI && zone->uz_fini)
4590 zone->uz_fini(item, zone->uz_size);
4591
4592 zone->uz_release(zone->uz_arg, &item, 1);
4593
4594 if (skip & SKIP_CNT)
4595 return;
4596
4597 counter_u64_add(zone->uz_frees, 1);
4598
4599 if (zone->uz_max_items > 0)
4600 zone_free_limit(zone, 1);
4601}
4602
4603/* See uma.h */
4604int

Callers 9

hash_freeFunction · 0.85
keg_free_slabFunction · 0.85
keg_alloc_slabFunction · 0.85
zone_dtorFunction · 0.85
uma_zdestroyFunction · 0.85
item_ctorFunction · 0.85
zone_alloc_itemFunction · 0.85
uma_zfree_smrFunction · 0.85
uma_zfree_argFunction · 0.85

Calls 4

smr_synchronizeFunction · 0.85
item_dtorFunction · 0.85
zone_free_limitFunction · 0.85
counter_u64_addFunction · 0.50

Tested by

no test coverage detected