Page MenuHomeFreeBSD

vm: fix swap reservation leak
ClosedPublic

Authored by mjg on Jul 23 2020, 1:35 PM.
Tags
None
Referenced Files
F81440609: D25787.diff
Tue, Apr 16, 9:37 AM
F81428974: D25787.id74877.diff
Tue, Apr 16, 5:41 AM
Unknown Object (File)
Mar 7 2024, 11:45 PM
Unknown Object (File)
Feb 20 2024, 3:16 AM
Unknown Object (File)
Jan 1 2024, 10:07 PM
Unknown Object (File)
Dec 20 2023, 8:18 AM
Unknown Object (File)
Nov 14 2023, 9:53 AM
Unknown Object (File)
Nov 8 2023, 12:52 PM
Subscribers

Details

Summary

If per-uid limit is exceeded, the cleanup fails to subtract from the global counter.

While here cleanup the code.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mjg requested review of this revision.Jul 23 2020, 1:35 PM

Since you are doing cleanups, perhaps change the return type to bool, there and for swap_reserve().

sys/vm/swap_pager.c
292

Please invert all conditions and s/||/&&/

  • way more refactoring

I'm working on a patch to introduce per-cpu counting here so this serves as a good prep.

sys/vm/swap_pager.c
216

priv_check() != 0

218

Might be, make this KASSERT

267–268

Move oc declaration above statics.

293

if (r > s && (oc & _ALLOW_NONWIRED) != 0) {

293–294

Again, make this KASSERT

297

And this

This revision is now accepted and ready to land.Jul 24 2020, 12:09 PM