P2: later
An appendix to the milestone.
P2: can follow later
-
#[must_use]is absent everywhere. Dropping theOptionfromallocoralloc_contiguousleaks a frame silently;containing,from_addr,addr,bitmap_bytes,page_frames_in,stats,Stats::free,largest_free_runandis_usedare pure. Add the attribute to all eleven. Evidence:src/lib.rslines 48 to 64,130-137,172,211,229,265,297. Door: two-way. Effort: XS. -
There is no
freefor a run.alloc_contiguoushands outcountframes and the two kernel callers that return them loop overfreeone frame at a time (kernel/src/e1000e.rslines 338 to 343,kernel/src/memory.rslines 1364 to 1369). Afree_contiguous(first, count)asserts once that the allocator owned the whole run and had it in use, and givesalloc_contiguousthe symmetric partnerbuddy_system_allocator::dealloc(start, count)has. Door: two-way now. Effort: S. -
alloc_contiguoustakes no alignment. A device that needs a run aligned beyond one frame cannot ask;bitmap-allocatorandbuddy_system_allocatorboth can. No caller in the tree needs it (the virtio ring fits one frame; the two network drivers ask for a run with no alignment). A## BUGSline in the README says so now;alloc_contiguous_aligned(count, align_frames)lands when a caller appears. Door: two-way. Effort: XS for the line. -
from_addrpanics on an unaligned address and offers no fallible form.x86_64'sPhysFrame::from_start_addressreturnsResult<_, AddressNotAligned>. Add aconst fnreturningOption<PageFrame>beside the panicking one (whichconstassertions in callers need); name provisional. Evidence:src/lib.rslines 48 to 54. Door: two-way (adding is compatible). Effort: XS. -
The crate assumes a 64-bit
usizeand does not say so.page_frames_in(src/lib.rsline 136) andindex_of(306) cast au64quotient withas usize. On a 32-bit target a span of 2^44 bytes or more truncates, andindex_ofcould pass its range check with a wrapped index. No such board exists for this tree, but the crate states no target bound and the template builds it for three. Addconst _: () = assert!(usize::BITS >= 64, "...")orusize::try_fromwith a documented refusal, and a## BUGSline. Door: two-way. Effort: XS. -
The crate-level
Name:paragraph garbles its own story: it says the kernel's capability type took the namePageFramewithout saying from what, and attributes the collision to a type where it was the word "frame" in the compositor. The kernel's kind isObject::PageFrame(kernel/src/capability_object.rsline 44). The move strips the block. Fix the sentence in nife so the history reads right. Evidence:src/lib.rslines 8 to 11. Door: two-way. Effort: XS. -
The three mutation survivors need their exemptions written before the first weekly run. nife's census argues all three equivalent (
alloc's hint,largest_free_run's boundary,alloc_contiguous's early return) and classifies the crate at zero real holes. The dry run carries the row into.github/mutants-exemptsas a comment only. Write the three entries with their arguments in the template's form, in the new repository. Evidence:notes/mutation-testing/baseline-survivors-abi-to-ipc.mdlines 150 to 160.notes/mutation-testing/survivor-classification.mdline 55. Door: two-way. Effort: XS. -
PageFramederivesOrdand notHash. Host tooling and tests that collect frames in a set (the tests useVec::contains) would want it. AddHashto the derive list. Evidence:src/lib.rsline 35. Door: two-way (adding a derive is compatible). Effort: XS. -
allocadvances the scan hint,freelowers it, andalloc_contiguousandmark_usedleave it alone. Correctness does not depend on it (the scan wraps) andfreesays so;alloc_contiguousdoes not. Verified by a throwaway test: after oneallocand onealloc_contiguous(4), the nextallocscans over the run and still answers the right frame. Either advance the hint past the run or say in the comment why the hint stays. Evidence:src/lib.rslines 123 to 125,229-255. Door: two-way. Effort: XS. -
notes/physical-memory.mdis stale on the nife side. It namesFrameAllocator::newand aninit. It gives a six-step order where the kernel's code has three loops (mark_freeeach RAM region,mark_usedeach forbidden region,mark_usedthe bitmap;kernel/src/memory.rslines 387 to 399). Edit it to the truth when the README of item 2 takes the arguments over, and point it at the crate's README for them. Evidence:notes/physical-memory.mdlines 48 to 66. Door: two-way. Effort: XS.