git: b6b0afefec47 - main - vm_swapout: Remove a special case from vm_swapout_map_deactivate_pages()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 15 Apr 2026 18:06:19 UTC
The branch main has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=b6b0afefec4739923897d984448704ce34a21e6b
commit b6b0afefec4739923897d984448704ce34a21e6b
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-04-15 18:00:38 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-04-15 18:00:38 +0000
vm_swapout: Remove a special case from vm_swapout_map_deactivate_pages()
John points out that this probably should have been removed in commit
472888018ce, which removed a special case where we'd set desired=0 if
the target process has P_INMEM clear. It's not obvious to me that the
desired=0 case can't arise by setting an RSS limit to 0, but I'm not
sure why we'd try to go the extra mile in that case anyway.
Reported by: jhb
Reviewed by: kib
MFC after: 2 weeks
Fixes: 472888018ce1 ("proc: Remove kernel stack swapping support, part 6")
Differential Revision: https://reviews.freebsd.org/D56140
---
sys/vm/vm_swapout.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/sys/vm/vm_swapout.c b/sys/vm/vm_swapout.c
index f510189d24be..e85a049f46fe 100644
--- a/sys/vm/vm_swapout.c
+++ b/sys/vm/vm_swapout.c
@@ -222,13 +222,11 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired)
{
vm_map_entry_t tmpe;
vm_object_t obj, bigobj;
- int nothingwired;
if (!vm_map_trylock_read(map))
return;
bigobj = NULL;
- nothingwired = TRUE;
/*
* first, search out the biggest object, and try to free pages from
@@ -249,8 +247,6 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired)
VM_OBJECT_RUNLOCK(obj);
}
}
- if (tmpe->wired_count > 0)
- nothingwired = FALSE;
}
if (bigobj != NULL) {
@@ -275,15 +271,6 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired)
}
}
- /*
- * Remove all mappings if a process is swapped out, this will free page
- * table pages.
- */
- if (desired == 0 && nothingwired) {
- pmap_remove(vm_map_pmap(map), vm_map_min(map),
- vm_map_max(map));
- }
-
vm_map_unlock_read(map);
}