diff options
| author | Mark Johnston <markj@FreeBSD.org> | 2026-08-11 14:10:23 +0000 |
|---|---|---|
| committer | Mark Johnston <markj@FreeBSD.org> | 2026-08-11 14:10:23 +0000 |
| commit | 12857d8f4269af7df85605b48ae5e7b2fd810fde (patch) | |
| tree | 53d030d782849ae758ca7d51afeccb40a969a0b5 | |
| parent | 6a8558cf9f0190cb166042f97d2c883d822e66b2 (diff) | |
vm_object: Augment an assertion in vm_object_split()
In some private discussion it was pointed out that vm_object_split()'s
pattern of dropping the source object lock looks dangerous in that the
initial assumption that OBJ_ONEMAPPING is set may become false. In
practice I believe that the map lock holds this flag stable, but let's
assert that.
Reviewed by: alc, kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D58766
| -rw-r--r-- | sys/vm/vm_object.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index aa2d7676e6a8..1e6e25d26a54 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1515,7 +1515,8 @@ vm_object_split(vm_map_entry_t entry) orig_object = entry->object.vm_object; KASSERT((orig_object->flags & OBJ_ONEMAPPING) != 0, - ("vm_object_split: Splitting object with multiple mappings.")); + ("%s: splitting object %p with multiple mappings", + __func__, orig_object)); if ((orig_object->flags & OBJ_ANON) == 0) return; if (orig_object->ref_count <= 1) @@ -1574,6 +1575,8 @@ vm_object_split(vm_map_entry_t entry) vm_object_set_flag(orig_object, OBJ_SPLIT); vm_page_iter_limit_init(&pages, orig_object, offidxstart + size); retry: + KASSERT((orig_object->flags & OBJ_ONEMAPPING) != 0, + ("%s: object %p lost ONEMAPPING", __func__, orig_object)); KASSERT(pctrie_iter_is_reset(&pages), ("%s: pctrie_iter not reset for retry", __func__)); for (m = vm_radix_iter_lookup_ge(&pages, offidxstart); m != NULL; |
