Agent skill

Kernel Memory Management

by mohitmishra786 in mohitmishra786/low-level-dev-skills

Kernel memory management skill for Linux mm subsystem. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check passedDevelopment

Install Kernel Memory Management

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill kernel-memory-management -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills kernel-memory-management --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/kernel-dev/kernel-memory-management .claude/skills/kernel-memory-management && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
kernel-memory-management
GitHub stars
253
Token cost
~848 tokens
SKILL.md length
243 words
Files
1
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

Kernel memory management skill for Linux mm subsystem. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 7 steps: Allocator decision tree → kmalloc and SLUB → vmalloc → …
  • Debugging OOM and memory zones
  • SKILL.md covers Purpose, When to Use, Workflow and Common Problems, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Kernel Memory Management is an agent skill from mohitmishra786/low-level-dev-skills. Kernel memory management skill for Linux mm subsystem. Use when using kmalloc, vmalloc, page allocator, SLUB, or debugging OOM and memory zones. Activates on queries about buddy allocator, kmalloc sizes, vmalloc vs kmalloc, SLUB, memory zones, or kernel OOM.

Its SKILL.md is about 850 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Debugging. It works with Linux. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Debugging OOM and memory zones
  • Tasks that involve Debugging

Example prompts

  • “/kernel-memory-management”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Allocator decision tree
  2. kmalloc and SLUB
  3. vmalloc
  4. Buddy page allocator
  5. NUMA basics
  6. Debugging
  7. Agent usage

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are c and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.kernel.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Kernel Memory Management loads about 848 tokens when it runs. Until then it costs about 71 tokens; SKILL.md has 243 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~848

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 243 words, ~848 tokens.

Download SKILL.mdSave it as .claude/skills/kernel-memory-management/SKILL.md (or your agent's skills folder).
name
kernel-memory-management
description
Kernel memory management skill for Linux mm subsystem. Use when using kmalloc, vmalloc, page allocator, SLUB, or debugging OOM and memory zones. Activates on queries about buddy allocator, kmalloc sizes, vmalloc vs kmalloc, SLUB, memory zones, or kernel OOM.

Kernel Memory Management

Purpose

Guide agents through Linux kernel memory allocation: physical page allocator (buddy), SLUB kmalloc caches, vmalloc virtual mappings, zones (DMA/Normal), and safe allocation patterns in drivers — extending skills/kernel/kernel-internals.

When to Use

  • Choosing kmalloc vs vmalloc vs get_free_pages
  • Debugging kernel OOM or slab corruption
  • DMA buffer allocation requirements
  • Understanding /proc/meminfo and slab stats

Workflow

1. Allocator decision tree
Need physically contiguous memory for DMA?
├── Yes → dma_alloc_coherent() or CMA pool
└── No
    ├── Size ≤ ~128K (arch-dependent) → kmalloc / kzalloc
    ├── Large or non-contiguous OK → vmalloc / vzalloc
    └── Whole pages → alloc_pages() / __get_free_pages()
2. kmalloc and SLUB

SLUB is the default general-purpose kmalloc backend (per kernel memory allocation guide); the legacy SLAB allocator was removed in Linux 6.12.

c
void *buf = kmalloc(size, GFP_KERNEL);
if (!buf)
    return -ENOMEM;
/* ... */
kfree(buf);
GFP flagContext
GFP_KERNELProcess context, may sleep
GFP_ATOMICIRQ / holding spinlock — smaller pools
GFP_DMADMA zone (legacy 32-bit devices)

Check /proc/slabinfo and cat /sys/kernel/slab/*/object_size.

3. vmalloc
c
void *v = vmalloc(size);  /* virtually contiguous, physically scattered */
vfree(v);

Use for large buffers where contiguous physical pages are unnecessary. Do not use for DMA without dma_map_*.

4. Buddy page allocator
c
struct page *page = alloc_pages(GFP_KERNEL, order);
void *addr = page_address(page);
__free_pages(page, order);

order n allocates 2^n pages. Zone selection: ZONE_DMA, ZONE_NORMAL, ZONE_MOVABLE (see include/linux/mmzone.h).

5. NUMA basics

On NUMA systems, kmalloc prefers local node; use alloc_pages_node() or mbind policies for HPC paths — see skills/allocators/numa-programming.

6. Debugging
bash
cat /proc/meminfo
cat /proc/slabinfo
dmesg | grep -i oom

Kernel config: CONFIG_SLUB_DEBUG, CONFIG_KASAN for use-after-free.

7. Agent usage
/kernel-memory-management Choose allocator for 2 MiB driver ring buffer in process context

Common Problems

SymptomCauseFix
kmalloc fails largeExceeds kmalloc limitUse vmalloc or pages
DMA buffer wrongUsed vmalloc for HW DMAdma_alloc_coherent
OOM killerUnbounded cache growthLimit pools; use shrinker
Slab corruptionUse-after-freeKASAN; audit kfree pairing
GFP_KERNEL in IRQSleeping allocator in atomicGFP_ATOMIC
  • skills/kernel/kernel-internals — page cache, OOM killer
  • skills/kernel/device-drivers — dma_alloc_coherent
  • skills/allocators/custom-allocators — userspace allocator design
  • skills/allocators/numa-programming — NUMA-aware allocation
  • skills/runtimes/sanitizers — KASAN overlap

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/kernel-dev/kernel-memory-management of mohitmishra786/low-level-dev-skills.

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Kernel Memory Management next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Kernel Memory Management compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Kernel Memory Management this skillmohitmishra786/low-level-dev-skills253—~848Automated safety check: PassMIT
PlotJuggler 4 Perf ProfilingPlotJuggler/PlotJuggler6.2k—~1.6kAutomated safety check: NotesMPL-2.0
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0
Gearcoleco Debuggingdrhelius/Gearcoleco141—~3.5kAutomated safety check: PassGPL-3.0
Issue Trackingstatic-web-server/static-web-server2.4k—~1.5kAutomated safety check: PassApache-2.0
OpenLogi Device DiagnosisAprilNEA/OpenLogi23k—~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • PlotJuggler 4 Perf Profiling

    PlotJuggler/PlotJuggler

    Guides CPU profiling of PlotJuggler 4 on Linux with perf: count first, record cheaply with LBR, then read per-thread, flat, flamegraph or time-window views.

    6.2k GitHub stars~1.6k tokensUpdated 6 days ago
    DevelopmentAuto-check: notes
  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Gearcoleco Debugging

    drhelius/Gearcoleco

    Debug and trace ColecoVision and Super Game Module games using the Gearcoleco emulator MCP server.

    141 GitHub stars~3.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Issue Tracking

    static-web-server/static-web-server

    Triage, debug, fix, and document issues for the Static Web Server (SWS) project — bug reports, root cause analysis, fix implementation, and regression prevention

    2.4k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • OpenLogi Device Diagnosis

    AprilNEA/OpenLogi

    Finds the first failing layer when an OpenLogi Logitech device is missing or misbehaving across enumeration, open, probe, IPC and UI.

    23k GitHub stars~1.6k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Dotnet Debugging

    novotnyllc/dotnet-artisan

    Debugs Windows and Linux/macOS applications (native, .NET/CLR, mixed-mode) with WinDbg MCP (crash dumps, !analyze, !syncblk, !dlk, !runaway, !dumpheap, !gcroot, BSOD), dotnet-dump, lldb with SOS…

    233 GitHub stars~2.1k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Kernel Memory Management

What does Kernel Memory Management do?

Kernel memory management skill for Linux mm subsystem. An agent skill from mohitmishra786/low-level-dev-skills. Kernel Memory Management is an agent skill from mohitmishra786/low-level-dev-skills. Kernel memory management skill for Linux mm subsystem.

When should I use Kernel Memory Management?

Kernel Memory Management fits situations like: debugging OOM and memory zones; tasks that involve Debugging.

How do I install Kernel Memory Management in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill kernel-memory-management -a claude-code`. Or copy the skill folder (skills/kernel-dev/kernel-memory-management in mohitmishra786/low-level-dev-skills) into .claude/skills/kernel-memory-management in your project. Claude Code loads it when a task matches its description.

How do I install Kernel Memory Management in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill kernel-memory-management -a codex`. Or copy the skill folder (skills/kernel-dev/kernel-memory-management in mohitmishra786/low-level-dev-skills) into .agents/skills/kernel-memory-management in your project. Codex loads it when a task matches its description.

Can I use Kernel Memory Management in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill kernel-memory-management -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/kernel-memory-management, .gemini/skills/kernel-memory-management, .github/skills/kernel-memory-management and .opencode/skills/kernel-memory-management in your project.

What does Kernel Memory Management need to run?

SKILL.md names no scripts, command-line tools or credentials: Kernel Memory Management is instructions for the agent only.

Does Kernel Memory Management access the network?

SKILL.md names 1 domain. As links in the text: docs.kernel.org. This is read from the text; nothing was executed.

Is Kernel Memory Management safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Kernel Memory Management use?

Kernel Memory Management is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Kernel Memory Management use?

About 848 tokens (SKILL.md is roughly 3.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Kernel Memory Management?

Skills that share tags, products or a category with Kernel Memory Management: PlotJuggler 4 Perf Profiling (PlotJuggler/PlotJuggler, 6.2k stars), The Art of Debugging (stas00/the-art-of-debugging, 1.7k stars), Gearcoleco Debugging (drhelius/Gearcoleco, 141 stars) and Issue Tracking (static-web-server/static-web-server, 2.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Kernel Memory Management?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.