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

Function vm_object_init

freebsd/vm/vm_object.c:276–308  ·  view source on GitHub ↗

* vm_object_init: * * Initialize the VM objects module. */

Source from the content-addressed store, hash-verified

274 * Initialize the VM objects module.
275 */
276void
277vm_object_init(void)
278{
279 TAILQ_INIT(&vm_object_list);
280 mtx_init(&vm_object_list_mtx, "vm object_list", NULL, MTX_DEF);
281
282 rw_init(&kernel_object->lock, "kernel vm object");
283 _vm_object_allocate(OBJT_PHYS, atop(VM_MAX_KERNEL_ADDRESS -
284 VM_MIN_KERNEL_ADDRESS), OBJ_UNMANAGED, kernel_object, NULL);
285#if VM_NRESERVLEVEL > 0
286 kernel_object->flags |= OBJ_COLORED;
287 kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS);
288#endif
289 kernel_object->un_pager.phys.ops = &default_phys_pg_ops;
290
291 /*
292 * The lock portion of struct vm_object must be type stable due
293 * to vm_pageout_fallback_object_lock locking a vm object
294 * without holding any references to it.
295 *
296 * paging_in_progress is valid always. Lockless references to
297 * the objects may acquire pip and then check OBJ_DEAD.
298 */
299 obj_zone = uma_zcreate("VM OBJECT", sizeof (struct vm_object), NULL,
300#ifdef INVARIANTS
301 vm_object_zdtor,
302#else
303 NULL,
304#endif
305 vm_object_zinit, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
306
307 vm_radix_zinit();
308}
309
310void
311vm_object_clear_flag(vm_object_t object, u_short bits)

Callers 1

vm_mem_initFunction · 0.85

Calls 5

mtx_initFunction · 0.85
rw_initFunction · 0.85
_vm_object_allocateFunction · 0.85
uma_zcreateFunction · 0.85
vm_radix_zinitFunction · 0.85

Tested by

no test coverage detected