* Import from the arena into the quantum cache in UMA. * * We use VMEM_ADDR_QCACHE_MIN instead of 0: uma_zalloc() returns 0 to indicate * failure, so UMA can't be used to cache a resource with value 0. */
| 547 | * failure, so UMA can't be used to cache a resource with value 0. |
| 548 | */ |
| 549 | static int |
| 550 | qc_import(void *arg, void **store, int cnt, int domain, int flags) |
| 551 | { |
| 552 | qcache_t *qc; |
| 553 | vmem_addr_t addr; |
| 554 | int i; |
| 555 | |
| 556 | KASSERT((flags & M_WAITOK) == 0, ("blocking allocation")); |
| 557 | |
| 558 | qc = arg; |
| 559 | for (i = 0; i < cnt; i++) { |
| 560 | if (vmem_xalloc(qc->qc_vmem, qc->qc_size, 0, 0, 0, |
| 561 | VMEM_ADDR_QCACHE_MIN, VMEM_ADDR_MAX, flags, &addr) != 0) |
| 562 | break; |
| 563 | store[i] = (void *)addr; |
| 564 | } |
| 565 | return (i); |
| 566 | } |
| 567 | |
| 568 | /* |
| 569 | * Release memory from the UMA cache to the arena. |
nothing calls this directly
no test coverage detected