mohitmishra786/low-level-dev-skills/virtual-memory-paging-and-tlb
Claude Code and agent skill by mohitmishra786/low-level-dev-skills
- community
Checking that the SKILL.md file is still in the repository.
Virtual memory skill for paging, page tables, and TLB. Use when explaining page faults, multi-level page tables, TLB behavior, or virtual vs physical addressing. Activates on queries about virtual memory, page table, TLB, page fault, mmap paging, or x86-64 paging.
Install
npx vskill@latest install mohitmishra786/low-level-dev-skills/virtual-memory-paging-and-tlbSKILL.md
Virtual Memory, Paging, and TLB
Purpose
Explain virtual memory: paging, multi-level page tables, TLB role, page faults, and address translation — bridging OS kernels, embedded MPU, and performance analysis.
When to Use
- Understanding
mmap,brk, and demand paging - Debugging segfaults and guard pages
- Huge pages / TLB pressure tuning
- Contrasting Cortex-M MPU with full MMU systems
Workflow
1. Translation overview
2. Page table (x86-64 4-level example)
Linux on x86_64 uses 4 KiB pages (default) and optional 2 MiB / 1 GiB huge pages.
3. Page fault types (simplified)
| Fault | Typical cause | |
|---|---|---|
| Major | Disk read — file-backed page not in RAM | |
| Minor | Zero-fill or COW break | |
| Protection | User access to kernel page, W^X violation |
4. TLB pressure
Large sparse address spaces + random pointer chasing → TLB misses dominate.
Mitigations:
mmaphuge pages (MAP_HUGETLB,madvise(MADV_HUGEPAGE))- Smaller working set / better locality
numactl --membindfor NUMA
5. Embedded contrast (Cortex-M)
Many MCUs use MPU (region-based) not full paging — no TLB, fixed region count. Application processors use MMU + OS.
See skills/platform/riscv-privileged for Sv39/Sv48.
6. Userspace inspection (Linux)
7. Agent usage
Common Problems
| Symptom | Cause | Fix | |
|---|---|---|---|
| Segfault | Unmapped VA | Fix pointer; check maps | |
| Slow mmap workload | TLB thrashing | Huge pages; reduce regions | |
| COW spike after fork | Shared pages split on write | Expected; consider MAP_POPULATE | |
| W^X fault | JIT without mprotect dance | Separate RW and RX mappings | |
| Wrong phys on MCU | No MMU — linear map | Use linker script addresses |
Related Skills
skills/computer-architecture/memory-hierarchy-and-caches— cache after translationskills/kernel-dev/kernel-memory-management— kernel page allocatorskills/kernel/os-dev-scratch— build paging from scratchskills/platform/riscv-privileged— Sv39 page tablesskills/allocators/numa-programming— NUMA and migration
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/computer-architecture/virtual-memory-paging-and-tlb/SKILL.md
Popularity
- Repository stars
- 237
- Repository forks
- 28
- 7-day trend score
- 27
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mohitmishra786/low-level-dev-skills/virtual-memory-paging-and-tlb)