P1.4: kernel heap — linked_list_allocator behind the kernel lock, alloc enabled #73
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.44) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 268 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.335
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #73"
general
weight: 0.35
garrickdabbs
Summary
Plan task P1.4: a kernel heap so
alloc(Vec,Box,BTreeMap, …) works insidechisel.Design
kernel::mm::heap: at boot, after paging, 256 fresh frames are mapped atKERNEL_DYNAMIC_BASE + 256 MiB(1 MiB, clear of the test/stack pages near the region's base) and handed tolinked_list_allocator::Heap.default-features = false(nospinning_top): the heap sits behind the kernel's ownSpinLock, and everyalloc/deallocruns underwithout_interrupts, so an interrupt handler can never deadlock against an allocation in progress.heap::stats()reports allocator usage and a bytes-in-use counter (sum of live layout sizes), the hook for Budget accounting in P2.4 (CLAUDE.md: every allocation path must charge a Budget — nothing to charge yet).heap: 1024 KiB at 0xffff900010000000 (… bytes used by the allocator itself).#[alloc_error_handler]reportskernel heap exhausted: allocation of N bytes (align A) failed; <heap stats>and takes the panic path;oom-teston the cmdline and the newoomsmoke scenario prove it (7 smoke scenarios now).Tests (AC:
Vec/Box/BTreeMapwork in kernel tests)heap_vec_box_and_btreemap_work: 10 000-elementVecwith checksum, 4 KiBBox,BTreeMapordering and lookup.heap_returns_memory_after_drop: 200 rounds of small + 32 KiB allocations; allocatorusedand bytes-in-use return exactly to baseline.Verification
fmt, clippy (host + kernel),
cargo deny check(new dependency: MIT/Apache-2.0, no transitive deps), docs-gate clean. PLAN §11 updated (P1.4 done, next P1.5).Closes #50
task: P1.4
🤖 Generated with Claude Code