Skip to content

lunatik: percpu:resume delivers to every instance - #792

Open
lneto wants to merge 1 commit into
claude_resume_resultsfrom
claude_percpu_resume
Open

lunatik: percpu:resume delivers to every instance#792
lneto wants to merge 1 commit into
claude_resume_resultsfrom
claude_percpu_resume

Conversation

@lneto

@lneto lneto commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

A percpu script that needs an object from the runtime that started it, the quarantine set of the ifquarantine example, has no way to get one: resume belongs to the plain runtime alone.

percpu:resume copies the objects into each instance and resumes it under the instance lock, where it also reads the state, since an instance dispatches as soon as its script registers a hook and a stopped one has no state left. Delivering the objects and resuming becomes one entry point, lunatik_resume, so that sequence is written once for both callers. Test: resume_percpu.

Based on #799.

@lneto
lneto force-pushed the claude_percpu_resume branch 2 times, most recently from 3830dda to 778a873 Compare September 6, 2026 23:06
@lneto
lneto changed the base branch from master to claude_resume_results September 7, 2026 13:57
@lneto
lneto force-pushed the claude_resume_results branch from 6baa91f to 3052934 Compare September 7, 2026 13:58
@lneto
lneto force-pushed the claude_percpu_resume branch from 778a873 to 0bf193e Compare September 7, 2026 13:58
A percpu script that needs an object handed to it by the runtime that
started it, the quarantine set of the ifquarantine example, had no way
to be given one: resume belonged to the plain runtime alone, so a script
that takes its state that way could not be an instance per CPU.
percpu:resume copies the objects into each instance and resumes it under
the instance's lock, where it also reads the state, since an instance
dispatches as soon as its script registers a hook and a stopped one has
no state left. The error an instance raises is copied out under that
lock and raised after it, naming the instance, because formatting it in
place would allocate under a spinlock. lunatik_copyobjects and
lunatik_resume lose their static to be reached from the percpu file.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lneto
lneto force-pushed the claude_percpu_resume branch from 0bf193e to 7a57e49 Compare September 7, 2026 14: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