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)
Thu, Apr 11, 3:08 PM
Unknown Object (File)
Thu, Apr 11, 2:08 PM
Unknown Object (File)
Mar 8 2024, 8:26 AM
Unknown Object (File)
Mar 7 2024, 5:04 AM
Unknown Object (File)
Mar 6 2024, 5:26 AM
Unknown Object (File)
Jan 16 2024, 8:52 AM
Unknown Object (File)
Jan 15 2024, 8:49 PM
Unknown Object (File)
Jan 15 2024, 9:18 AM

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 Skipped
Unit
Tests Skipped

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