(Follow-up, not a regression) A task woken by an IRQ handler on CPU 0 can still wait until the sleep ends

オープン
#805 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust

調査の方向性

Read kernel/src/lib.rs:109-136 and awkernel_lib/src/cpu/sleep_cpu_no_std.rs, focusing on sleep and wake_up; trace how an IRQ that enqueues a task affects the current CPU while its tag is Active. Check the existing model and identify what must change so this wake path is covered. Done means the task does not wait for the sleep timeout after that IRQ, with a model update covering the path.

索引モデルが issue の本文から書いたものです。

説明

File: kernel/src/lib.rs:109-136, awkernel_lib/src/cpu/sleep_cpu_no_std.rs
(sleep, wake_up).

The primary CPU runs with interrupts disabled except in the IRQ window at the
top of the loop and inside sleep_cpu(). An IRQ that arrives during
wake_task() or wake_workers() is handled right after
InterruptEnable::new() in sleep(), while the tag is still Active. If the
handler wakes a task:

  • wake_cpu(0) targets the current CPU and does nothing.
  • reset_wakeup_timer() does nothing, because the tag is Active.
  • The CPU then moves to Waiting and halts until the timeout (up to 1 second),
    with NUM_TASK_IN_QUEUE > 0 and possibly all workers asleep.

This window existed before, and it was wider in the old order. But the
saturated counter kept the primary CPU spinning, which hid the delay; with an
exact counter it becomes visible, in the same way as the timer case that this
PR fixes.

One possible fix is to let wake_up() on the current CPU change Active to
Continue, so that the next sleep() returns at once. The current model does
not cover this path, because its interrupt handlers do not enqueue tasks, so
such a change should come with a model update.

主要言語
Rust
スター
282
フォーク
12
平均マージ
2日 9時間
マージ済み PR(30日)
28

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tier4/awkernel のほかの issue

tier4/awkernel の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。