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
F168920059: D58283.id182081.diff
Sun, Aug 30, 6:38 PM
F168913210: D58283.id.diff
Sun, Aug 30, 5:39 PM
F168907758: D58283.id182081.diff
Sun, Aug 30, 5:10 PM
F168893358: D58283.id182079.diff
Sun, Aug 30, 3:41 PM
F168780057: D58283.id182079.diff
Sun, Aug 30, 3:06 AM
F168779467: D58283.id182079.diff
Sun, Aug 30, 3:02 AM
F168771656: D58283.id182078.diff
Sun, Aug 30, 2:02 AM
F168771356: D58283.id182078.diff
Sun, Aug 30, 2:00 AM

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 Skipped
Unit
Tests Skipped
Build Status
Buildable 74851
Build 71734: arc lint + arc unit

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