Page MenuHomeFreeBSD

vm_map: Record the maximum size of the map over time
Needs ReviewPublic

Authored by markj on Fri, Oct 4, 3:07 PM.

Details

Reviewers
alc
kib
dougm
Summary

This might be useful for some emulation layers, see bugzilla report

PR: 259940

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 59760
Build 56646: arc lint + arc unit

Event Timeline

markj requested review of this revision.Fri, Oct 4, 3:07 PM

In kern/kern_exec.c:exec_new_vmspace(), in case the existing vmspace is reused, I believe the maxspace needs to be reset to zero,

sys/vm/vm_map.c
1761–1764

This place should be also handled.

4926–4928

And this.

sys/sys/user.h
216

Why the new field is put there and not in kinfo_vm_layout?

markj marked 2 inline comments as done.Fri, Oct 4, 3:43 PM
markj added inline comments.
sys/sys/user.h
216

Mostly because we already export the map size there. IMO it should be added to kinfo_vm_layout as well (the map size is missing there), but we might as well have it here as well so that existing users can use it conveniently.

Address kib's comments, export map size and max size in the vm_layout sysctl as well.

sys/sys/user.h
216

kinfo_vm_layout is much easier to expand, even if spaces are fully utilized. We only return kinfo_vm_layout for single process, so we can detect old programs requests by comparing the size.

While for kinfo_proc, the structure is often is returned in the array, so exhausting the spares means that we need to add yet another oid with all backward-compat machinery.

This is why I asked to move the new field to vm_layout.

sys/vm/vm_map.c
4338

I remember the previous version simply copied the vm_map.size on fork. Why change?