Page MenuHomeFreeBSD

sysctl vm.objects: report backing object and swap use
ClosedPublic

Authored by kib on Apr 15 2021, 9:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 5 2024, 11:58 AM
Unknown Object (File)
Oct 4 2024, 8:35 PM
Unknown Object (File)
Oct 2 2024, 11:33 AM
Unknown Object (File)
Oct 2 2024, 4:57 AM
Unknown Object (File)
Oct 1 2024, 1:14 PM
Unknown Object (File)
Sep 30 2024, 6:48 PM
Unknown Object (File)
Sep 30 2024, 3:33 PM
Unknown Object (File)
Sep 29 2024, 12:52 PM

Details

Summary

For anonymous objects, provide a handle kvo_me naming the object, and report the handle of the backing object. This allows userspace to deconstruct the shadow chain. Right now the handle is the address of the object in KVA, but this is not guaranteed.

For the same anonymous objects, report the swap space used for actually swapped out pages, in kvo_swapped field. I do not believe that it is useful to report full 64bit counter there, so only uint32_t value is returned, clamped to the max.

For kinfo_vmentry, report anonymous object handle backing the entry, so that the shadow chain for the specific mapping can be deconstructed.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Apr 15 2021, 9:32 AM
kib created this revision.
kib edited the summary of this revision. (Show Details)

Report backing object for vm entry.

sys/vm/swap_pager.c
1779

Doesn't this loop need to update pi somewhere?

1781

sb->d[i] != SWAPBLK_NONE, I think.

sys/vm/vm_object.c
2599

It'd be a bit more interesting to assert on kvo_type, IMO.

kib marked 3 inline comments as done.

Fix bugs in the swap trie iteration.

This revision is now accepted and ready to land.Apr 15 2021, 4:19 PM