* 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 */
| 4572 | * skip Skip dtors and finis |
| 4573 | */ |
| 4574 | static __noinline void |
| 4575 | zone_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 */ |
| 4604 | int |
no test coverage detected