]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
vm: fix swap reservation leak and clean up surrounding code
authormjg <mjg@FreeBSD.org>
Fri, 24 Jul 2020 13:23:32 +0000 (13:23 +0000)
committermjg <mjg@FreeBSD.org>
Fri, 24 Jul 2020 13:23:32 +0000 (13:23 +0000)
commitd6d69d175fe02b59ed7f4f1d53ec8c0199624350
treee2623143df36eaedec26c42dd6d910db489c878d
parent265ebdf0714e1ae53c3ab622c701e30a36942e18
vm: fix swap reservation leak and clean up surrounding code

The code did not subtract from the global counter if per-uid reservation
failed.

Cleanup highlights:
- load overcommit once
- move per-uid manipulation to dedicated routines
- don't fetch wire count if requested size is below the limit
- convert return type from int to bool
- ifdef the routines with _KERNEL to keep vm.h compilable by userspace

Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D25787
sys/vm/swap_pager.c
sys/vm/vm.h