Page MenuHomeFreeBSD

Add sysctl vm.objects_swap
ClosedPublic

Authored by kib on Jul 13 2021, 10:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Mar 9, 4:03 AM
Unknown Object (File)
Sat, Mar 9, 4:03 AM
Unknown Object (File)
Sat, Mar 9, 4:03 AM
Unknown Object (File)
Sat, Mar 9, 1:26 AM
Unknown Object (File)
Sat, Mar 9, 1:26 AM
Unknown Object (File)
Fri, Mar 8, 11:45 PM
Unknown Object (File)
Jan 29 2024, 2:44 AM
Unknown Object (File)
Jan 17 2024, 7:08 AM

Details

Summary

vm.objects_swap: disable reporting some information

For making the call faster, do not count active/inactive object queues, and do not report vnode info if any (for tmpfs).

See D29754

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kib requested review of this revision.Jul 13 2021, 10:37 AM
kib created this revision.

Add the 'yield if hog' patch

sys/vm/vm_object.c
2517

Why examine objects with OBJ_ANON set and OBJ_SWAP clear?

sys/vm/vm_object.c
2517

Because these are logically swap objects. The fact that the system yet did not swapped anything from their page queue does not imply anything.

Hm, even more, if I skip such objects there, then sysinfo(8) would not be able to reconstruct full shadow chain. So it is not the question of interpretation, but in fact required to do.

markj added inline comments.
sys/vm/vm_object.c
2517

I think this deserves a comment, then, since swap_only is not quite accurate. Naively I understand that the new sysctl is used to display information about swap usage, and it is tempting to "optimize" this loop by excluding OBJT_DEFAULT objects since by definition they have never undergone pageouts.

2552–2553

You could avoid calling pgo_getvp calls in vm_object_kvme_type() by passing swap_only ? NULL : &vp instead (with vp initialized to NULL).

This revision is now accepted and ready to land.Oct 25 2021, 1:18 PM
kib marked 3 inline comments as done.

Optimize vp calculation.
Add detailed comment about new sysctl.

This revision now requires review to proceed.Oct 25 2021, 1:45 PM
This revision is now accepted and ready to land.Oct 25 2021, 1:56 PM