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

Function qc_import

freebsd/kern/subr_vmem.c:549–566  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

547 * failure, so UMA can't be used to cache a resource with value 0.
548 */
549static int
550qc_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.

Callers

nothing calls this directly

Calls 1

vmem_xallocFunction · 0.85

Tested by

no test coverage detected