Page MenuHomeFreeBSD

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

Authored by kib on Apr 15 2021, 9:32 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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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
1778

Doesn't this loop need to update pi somewhere?

1780

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

sys/vm/vm_object.c
2598

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