Skip to content

checklocks: guard async page I/O bookkeeping - #14348

Open
tamird wants to merge 5 commits into
google:masterfrom
tamird:checklocks-pgalloc-async-state
Open

checklocks: guard async page I/O bookkeeping#14348
tamird wants to merge 5 commits into
google:masterfrom
tamird:checklocks-pgalloc-async-state

Conversation

@tamird

@tamird tamird commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Depends on #14283 and #14281. The change specific to this proposal is 18a2729. The current comparison against master also includes prerequisite commits; those prerequisites must land and be removed from this branch before submission.

Guard pending page ranges and throughput counters under the saver mutex. Guard the active MemoryFile list and loader wait accounting. Require atomic access to loader errors and the first-unloaded-byte hint, with locked error stores. Enforce the existing incRefLocked precondition.

Use the generic atomic classification from b11b0d7 to check the async-load state and chunk metadata pointers. Preserve growth locking, immutable slice headers and restore/destruction mapping changes.

Preserve lifecycle-only access to PagesFileOffset and document parent ownership of callbacks, segment values and waiters. The per-file completion callback is mutable and cleared after invocation. Keep prose contracts for passed callbacks, child-to-parent aliases and list links.

Assisted-by: Codex

tamird added 2 commits August 22, 2026 04:21
Template merging discards comments that are not attached to declaration
fields, including inline analyzer annotations. Preserve comments on
surviving nodes and render declarations separately so hoisted imports
cannot move another function's annotations. Keep original import
declarations when removing duplicate specs so their comment positions
remain valid. Reconstruct build constraints separately and continue
omitting package documentation in instances.

Extend the existing template fixture with inline annotations, reversed
source order and imports from different files. Preserve existing inline
prose in the anonymous-field fixture as well.

Assisted-by: Codex
Analyzing runsc with its lockdep build tag exposes the validator's map
and stack-trace allocations beneath recursive checkescape contracts.
Define those contracts to exclude optional lock-validator bookkeeping.
Exempt only AddGLock and DelGLock calls in generated mutexes, leaving
underlying mutex operations and application allocations checked.

This is an analysis-policy boundary, not a claim that lockdep execution
is allocation-free. Keep the exclusion explicit in the locking package.

Assisted-by: Codex
@tamird

tamird commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

r? @nybidari Could you review asynchronous page-I/O bookkeeping and generic atomic-pointer contracts?

Focused local Bazel checks passed. Upstream checks have not reported yet. This comparison currently includes the prerequisites linked in the description.

cc @EtiennePerot

Assisted-by: Codex

tamird added 3 commits August 22, 2026 09:17
Nogo currently reads ambient build tags instead of the analyzed target's
transitioned context. Its binary wrapper also recreates binaries as
libraries, losing binary-specific tags and analyzing a different source
configuration from the compiler.

Use the aspect target's Go context and analyze binaries through their
actual compiled archive and export data. Keep internal test-package
archive selection separate from generated test mains. A tagged binary
regression detects missing tags, linked-away functions and conservative
fallback after failed object inspection.

Assisted-by: Codex
Recognize atomicbitops Racy methods as non-atomic operations. Permit
mixed-mode RacyLoad only when all guards are held, and require atomic
writes with all guards held exclusively. Distinguish shared-lock reads
from lock-free atomic reads so an RLock cannot authorize writes.

Check atomic uses of annotated globals at the consuming instruction
instead of discarding that instruction. Keep unannotated-global behavior
unchanged, preserve function and closure ignores, and distinguish writes
to a global from stores of its address.

Resolve generic instantiations to their original declarations before
classifying atomic operations. This recognizes atomic.Pointer methods
without bypassing package or mixed-access checks for generic calls.

Assisted-by: Codex
Guard saver offsets, pending ranges and throughput counters, plus the
loader's active-file list, wait accounting and per-file completion
state. Require atomic access to loader errors and the
first-unloaded-byte hint, with locked error stores.

Check the async-load and chunk metadata pointers using the prerequisite
generic atomic support. Enforce the chunk-growth, destruction,
reference-counting and waste-cancellation helper contracts. Document
phase-dependent chunk ownership instead of imposing a mutex rule on
private construction and restore.

Keep normal accesses checked and place the save-offset lifetime
exception at its serial checkpoint caller. Identify parent mutexes lost
through list, priority-queue and completion-record lookups, and explain
passed-callback exceptions. Preserve prose for generated links, segment
values and waiters without a recoverable owner, and retain pooled-waiter
and mapping lifetimes.

Assisted-by: Codex
@tamird
tamird force-pushed the checklocks-pgalloc-async-state branch from 18a2729 to baa9d00 Compare August 22, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant