Konstantin Belousov <kib_at_FreeBSD.org> wrote on Date: Mon, 24 Nov 2025 18:09:09 UTC :
> The branch main has been updated by kib: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=72a447d0bc768c7fe8a9c972f710c75afebd581b > > commit 72a447d0bc768c7fe8a9c972f710c75afebd581b > Author: Konstantin Belousov <[email protected]> > AuthorDate: 2025-11-22 20:39:27 +0000 > Commit: Konstantin Belousov <[email protected]> > CommitDate: 2025-11-24 18:08:31 +0000 > > vm_object_page_remove(): clear pager even if there is no resident pages > > Swap pager might still carry the data. > > Debugging help from: mmel > Reviewed by: alc > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D53891 > --- > sys/vm/vm_object.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c > index 5b4517d2bf0c..413ba5459e3d 100644 > --- a/sys/vm/vm_object.c > +++ b/sys/vm/vm_object.c > @@ -1988,7 +1988,7 @@ vm_object_page_remove(vm_object_t object, vm_pindex_t > start, vm_pindex_t end, > (options & (OBJPR_CLEANONLY | OBJPR_NOTMAPPED)) == OBJPR_NOTMAPPED, > ("vm_object_page_remove: illegal options for object %p", object)); > if (object->resident_page_count == 0) > - return; > + goto remove_pager; > vm_object_pip_add(object, 1); > vm_page_iter_limit_init(&pages, object, end); > again: > @@ -2061,6 +2061,7 @@ wired: > } > vm_object_pip_wakeup(object); > > +remove_pager: > vm_pager_freespace(object, start, (end == 0 ? object->size : end) - > start); > } There is still some question about which way another test should be in vm_object_coalesce. But the above should be necessary, even if it is not always sufficient to prevent all potential failure types. See https://reviews.freebsd.org/D53891 for the status of what may be a pending additional change. === Mark Millard marklmi at yahoo.com
