/odin-native:virtual-memory-paging-and-tlbfrom ODIN Native
Explains page faults, multi-level page tables, TLB misses, huge pages, and mmap/brk behavior. Reads /proc and /sys files and pmap output to diagnose memory access issues.
Ships in ODIN Native. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Field | Bound contract |
|---|---|
| Trigger | A segfault or guard page needs explaining, mmap or brk behavior is in question, a sparse workload is TLB-bound, or a Cortex-M MPU needs contrasting with a full MMU. |
| Authority | Read-only. The skill reads /proc and /sys files and pmap output and answers in chat. Nothing on disk changes, so there is nothing to roll back. No remote mutation. |
| Side effect | Chat output only. |
| Done | The translation path, the fault class, and the page size in play are named, with the /proc evidence quoted where a process exists. |
CR3 points at the PML4, which points at a PDPT, then a PD, then a PT, then the frame. Linux on x86-64 uses 4 KiB pages by default and can back a region with 2 MiB or 1 GiB huge pages. Done when: the level count and page sizes for the target are stated.| Fault | Cause |
|---|---|
| Major | A file-backed page is not in memory and needs a disk read |
| Minor | Zero-fill of a fresh anonymous page, or a copy-on-write break after fork |
| Protection | A write to a read-only mapping, an execute of a non-executable page, or a user access to a kernel address |
grep pgfault /proc/vmstat # system-wide minor plus major faults
perf stat -e page-faults,minor-faults,major-faults ./app
mmap with MAP_HUGETLB, or madvise(MADV_HUGEPAGE) on a region when /sys/kernel/mm/transparent_hugepage/enabled is always or madvise.numactl --membind so the walk hits local memory; use numa-programming.perf stat -e dTLB-load-misses,iTLB-load-misses ./app
cat /proc/self/maps
pmap -x <pid>
os-dev-scratch and the kernel skills. Done when: the user knows whether the target translates at all.For the cache behind translation, use memory-hierarchy-and-caches. For the kernel side of the fault handler and the allocator, use kernel-memory-management.
| Failure class | Behavior |
|---|---|
| Segfault at an address | Check /proc/<pid>/maps. An address outside every mapping is a stray pointer; one inside a mapping with the wrong permission is a protection fault. |
Slow mmap workload | TLB thrashing. Try huge pages on the hot region and re-measure dTLB-load-misses. |
Fault spike after fork | Copy-on-write breaks as the child writes shared pages. This is expected; MAP_POPULATE prefaults a mapping when the cost must move to setup. |
| Write-xor-execute fault in a JIT | Keep a writable mapping and an executable mapping separate, or flip permissions with mprotect between write and run. |
| Wrong physical address on a microcontroller | There is no MMU. Use the addresses the linker script assigns. |
perf stat denied | Report the perf_event_paranoid value the tool prints. Do not change the sysctl. |
A chat answer that traces the access path, names the fault class and page size, quotes the mapping or counter evidence where a process exists, and states one mitigation with the condition under which it helps.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub outlinedriven/odin-claude-plugin --plugin odin-native138 skills in this plugin
/abi-and-calling-conventionsUse when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi./adc-dac-baremetalUse when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal./af-xdpUse when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.Other plugins' skills for the same job