]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Call swap_pager_freespace() from vm_object_page_remove().
authorMark Johnston <markj@FreeBSD.org>
Thu, 25 Jun 2020 15:21:21 +0000 (15:21 +0000)
committerMark Johnston <markj@FreeBSD.org>
Thu, 25 Jun 2020 15:21:21 +0000 (15:21 +0000)
commit84242cf68a82071a388472925d539ed9817ceb6d
treef2eb818e3db7e43535bab9fa2204e6c4d9db2cb8
parent0a1016f9e8a84edc8eb21e4f776b18b19fdd26ce
Call swap_pager_freespace() from vm_object_page_remove().

All vm_object_page_remove() callers, except
linux_invalidate_mapping_pages() in the LinuxKPI, free swap space when
removing a range of pages from an object.  The LinuxKPI case appears to
be an unintentional omission that could result in leaked swap blocks, so
unconditionally free swap space in vm_object_page_remove() to protect
against similar bugs in the future.

Reviewed by: alc, kib
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D25329
sys/dev/md/md.c
sys/fs/tmpfs/tmpfs_subr.c
sys/kern/uipc_shm.c
sys/vm/vm_map.c
sys/vm/vm_object.c