refactor(rcu): make raw callback admission intrusive - #2217
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d197d1c04f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if KernelThreadMechanism::create_and_run(closure, "rcu_gp".to_string()).is_none() { | ||
| RCU_STATE.worker_started.store(false, Ordering::Release); | ||
| { | ||
| let _inner = RCU_STATE.inner.lock_irqsave(); | ||
| RCU_STATE.worker_starting.store(false, Ordering::Release); |
There was a problem hiding this comment.
当 create_and_run 因内存压力或进程创建失败返回 None 时,启动流程在 initial_kthread.rs:72 只调用一次 start_worker(),而此分支仅清除 worker_starting 后继续启动;本提交又移除了 quiescent-state、idle/IRQ 等路径在无工作线程时的内联处理,且 progress_and_drain_inline_if_no_worker() 只由 rcu_barrier() 调用。因此后续普通 rcu_defer_drop() 回调即使已度过宽限期也不会执行,除非其他代码偶然调用 rcu_barrier(),持续更新的 RCU 槽会无界保留旧对象并进一步加剧内存压力。这里需要可靠重试、初始化失败,或可从任务上下文触发的后备回调协调器。
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Replace the growable pending and ready callback queues with one global intrusive FIFO backed by RcuHead. Raw callback publication now performs bounded pointer and sequence updates under the IRQ-saving RCU lock without reserving container capacity. Detach callback metadata before invocation so embedded heads can be destroyed or requeued safely. Preserve FIFO, grace-period, exactly-once, and barrier sequencing through the existing callback tracker, while keeping allocating closure helpers explicitly separate from the raw path. Tighten worker progress and lifecycle handling, avoid unnecessary wakeups while a grace period is blocked, and add deterministic coverage for allocation failure, duplicate claims, IRQ-disabled admission, embedded destruction, callback requeue, and sequence wraparound. Validated with make fmt, make kernel, the QEMU debugfs RCU selftest, and the rcu_selftest dunitest. Closes DragonOS-Community#2212 Signed-off-by: longjin <longjin@dragonos.org>
Treat the RCU callback worker as required boot infrastructure. Continuing after kthread creation failure leaves intrusive callback heads and deferred closures queued without an asynchronous drainer, so their resources can remain retained indefinitely. Fail fast before the kernel continues initialization, while preserving the existing disabled, idempotent, successful-start, and shutdown paths. This avoids introducing retry state, fallback executors, or callback execution in unsafe contexts. Validated with make fmt, make kernel, a QEMU failure-injection boot, normal QEMU boot, two debugfs RCU selftest runs, and the rcu_selftest dunitest. Signed-off-by: longjin <longjin@dragonos.org>
92aeb91 to
9520f5b
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
RcuHeadrcu_barrier()sequencingSafety and ordering
Validation
make fmtmake kernel/sys/kernel/debug/rcu/selftest:status=okrcu_selftest_test: all tests passed, including repeated stability runsCloses #2212