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

Function pcpu_page_free

freebsd/vm/uma_core.c:1939–1962  ·  view source on GitHub ↗

* Frees pcpu zone allocations * * Arguments: * mem A pointer to the memory to be freed * size The size of the memory being freed * flags The original p->us_flags field * * Returns: * Nothing */

Source from the content-addressed store, hash-verified

1937 * Nothing
1938 */
1939static void
1940pcpu_page_free(void *mem, vm_size_t size, uint8_t flags)
1941{
1942 vm_offset_t sva, curva;
1943 vm_paddr_t paddr;
1944 vm_page_t m;
1945
1946 MPASS(size == (mp_maxid+1)*PAGE_SIZE);
1947
1948 if ((flags & UMA_SLAB_BOOT) != 0) {
1949 startup_free(mem, size);
1950 return;
1951 }
1952
1953 sva = (vm_offset_t)mem;
1954 for (curva = sva; curva < sva + size; curva += PAGE_SIZE) {
1955 paddr = pmap_kextract(curva);
1956 m = PHYS_TO_VM_PAGE(paddr);
1957 vm_page_unwire_noq(m);
1958 vm_page_free(m);
1959 }
1960 pmap_qremove(sva, size >> PAGE_SHIFT);
1961 kva_free(sva, size);
1962}
1963#else
1964static void
1965pcpu_page_free(void *mem, vm_size_t size, uint8_t flags)

Callers

nothing calls this directly

Calls 8

startup_freeFunction · 0.85
PHYS_TO_VM_PAGEFunction · 0.85
vm_page_unwire_noqFunction · 0.85
vm_page_freeFunction · 0.85
kva_freeFunction · 0.85
page_freeFunction · 0.85
pmap_kextractFunction · 0.50
pmap_qremoveFunction · 0.50

Tested by

no test coverage detected