Page MenuHomeFreeBSD

vm_phys: Add a sysctl to dump registered fictitious memory ranges
ClosedPublic

Authored by markj on Jul 16 2026, 2:03 PM.
Tags
None
Referenced Files
F167450395: D58283.id.diff
Fri, Aug 21, 8:36 PM
Unknown Object (File)
Tue, Aug 18, 1:12 PM
Unknown Object (File)
Wed, Aug 12, 6:02 PM
Unknown Object (File)
Tue, Aug 11, 6:27 AM
Unknown Object (File)
Mon, Aug 10, 10:22 PM
Unknown Object (File)
Mon, Aug 10, 6:53 PM
Unknown Object (File)
Mon, Aug 10, 7:34 AM
Unknown Object (File)
Sun, Aug 9, 8:36 PM

Details

Summary

I've wanted this a couple of times in the past. Save the memattr in
the fictitious memory segment structure so that we can report it from
the sysctl handler, and add conversion routines for each platform.

Diff Detail

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

Event Timeline

markj requested review of this revision.Jul 16 2026, 2:03 PM
sys/vm/vm_phys.c
372

The why not return "???" from vm_memattr_name()? I would print the numeric value of the unknown memattr.

Print a number if memattr decoding fails

markj added inline comments.
sys/vm/vm_phys.c
372

The why not return "???" from vm_memattr_name()?

Returning NULL indicates that the memattr was not decoded, it seems better to give that extra information to the caller and let them decide how to handle it.

I would print the numeric value of the unknown memattr.

Ok

kib added inline comments.
sys/vm/vm_phys.c
374

I suspect that the width 2 is too narrow, since '0x' from '#' counts there.

This revision is now accepted and ready to land.Jul 16 2026, 3:32 PM
markj marked an inline comment as done.

Fix formatting

This revision now requires review to proceed.Jul 16 2026, 3:44 PM
This revision is now accepted and ready to land.Jul 16 2026, 3:44 PM