]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add a deferred free mechanism for freeing swap space that does not require
authorjeff <jeff@FreeBSD.org>
Sun, 15 Dec 2019 03:15:06 +0000 (03:15 +0000)
committerjeff <jeff@FreeBSD.org>
Sun, 15 Dec 2019 03:15:06 +0000 (03:15 +0000)
commit011da14d3951d1578610a1904b2ca1e001f0d200
treec99d966314ef679adeaa8e12bb2cb88becf174ef
parentdae9c133553061bf60b6a0aa40cc824646bef633
Add a deferred free mechanism for freeing swap space that does not require
an exclusive object lock.

Previously swap space was freed on a best effort basis when a page that
had valid swap was dirtied, thus invalidating the swap copy.  This may be
done inconsistently and requires the object lock which is not always
convenient.

Instead, track when swap space is present.  The first dirty is responsible
for deleting space or setting PGA_SWAP_FREE which will trigger background
scans to free the swap space.

Simplify the locking in vm_fault_dirty() now that we can reliably identify
the first dirty.

Discussed with: alc, kib, markj
Differential Revision: https://reviews.freebsd.org/D22654
sys/dev/md/md.c
sys/fs/tmpfs/tmpfs_subr.c
sys/kern/uipc_shm.c
sys/vm/swap_pager.c
sys/vm/vm_fault.c
sys/vm/vm_page.c
sys/vm/vm_page.h
sys/vm/vm_pageout.c
sys/vm/vm_pager.h