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

Function vm_fault_next

freebsd/vm/vm_fault.c:998–1038  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996}
997
998static bool
999vm_fault_next(struct faultstate *fs)
1000{
1001 vm_object_t next_object;
1002
1003 /*
1004 * The requested page does not exist at this object/
1005 * offset. Remove the invalid page from the object,
1006 * waking up anyone waiting for it, and continue on to
1007 * the next object. However, if this is the top-level
1008 * object, we must leave the busy page in place to
1009 * prevent another process from rushing past us, and
1010 * inserting the page in that object at the same time
1011 * that we are.
1012 */
1013 if (fs->object == fs->first_object) {
1014 fs->first_m = fs->m;
1015 fs->m = NULL;
1016 } else
1017 fault_page_free(&fs->m);
1018
1019 /*
1020 * Move on to the next object. Lock the next object before
1021 * unlocking the current one.
1022 */
1023 VM_OBJECT_ASSERT_WLOCKED(fs->object);
1024 next_object = fs->object->backing_object;
1025 if (next_object == NULL)
1026 return (false);
1027 MPASS(fs->first_m != NULL);
1028 KASSERT(fs->object != next_object, ("object loop %p", next_object));
1029 VM_OBJECT_WLOCK(next_object);
1030 vm_object_pip_add(next_object, 1);
1031 if (fs->object != fs->first_object)
1032 vm_object_pip_wakeup(fs->object);
1033 fs->pindex += OFF_TO_IDX(fs->object->backing_object_offset);
1034 VM_OBJECT_WUNLOCK(fs->object);
1035 fs->object = next_object;
1036
1037 return (true);
1038}
1039
1040static void
1041vm_fault_zerofill(struct faultstate *fs)

Callers 1

vm_faultFunction · 0.85

Calls 3

fault_page_freeFunction · 0.85
vm_object_pip_addFunction · 0.85
vm_object_pip_wakeupFunction · 0.85

Tested by

no test coverage detected