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

Function vm_map_entry_create

freebsd/vm/vm_map.c:969–1002  ·  view source on GitHub ↗

* vm_map_entry_create: [ internal use only ] * * Allocates a VM map entry for insertion. * No entry fields are filled in. */

Source from the content-addressed store, hash-verified

967 * No entry fields are filled in.
968 */
969static vm_map_entry_t
970vm_map_entry_create(vm_map_t map)
971{
972 vm_map_entry_t new_entry;
973
974#ifndef UMA_MD_SMALL_ALLOC
975 if (map == kernel_map) {
976 VM_MAP_ASSERT_LOCKED(map);
977
978 /*
979 * A new slab of kernel map entries cannot be allocated at this
980 * point because the kernel map has not yet been updated to
981 * reflect the caller's request. Therefore, we allocate a new
982 * map entry, dipping into the reserve if necessary, and set a
983 * flag indicating that the reserve must be replenished before
984 * the map is unlocked.
985 */
986 new_entry = uma_zalloc(kmapentzone, M_NOWAIT | M_NOVM);
987 if (new_entry == NULL) {
988 new_entry = uma_zalloc(kmapentzone,
989 M_NOWAIT | M_NOVM | M_USE_RESERVE);
990 kernel_map->flags |= MAP_REPLENISH;
991 }
992 } else
993#endif
994 if (map->system_map) {
995 new_entry = uma_zalloc(kmapentzone, M_NOWAIT);
996 } else {
997 new_entry = uma_zalloc(mapentzone, M_WAITOK);
998 }
999 KASSERT(new_entry != NULL,
1000 ("vm_map_entry_create: kernel resources exhausted"));
1001 return (new_entry);
1002}
1003
1004/*
1005 * vm_map_entry_set_behavior:

Callers 4

vm_map_insertFunction · 0.85
vm_map_entry_cloneFunction · 0.85
vm_map_copy_entryFunction · 0.85
vmspace_forkFunction · 0.85

Calls 1

uma_zallocFunction · 0.70

Tested by

no test coverage detected