OSPP 2026 idea: Lazy FP/RVV context switching for RISC-V
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c
調査の方向性
まず、RISC-V のスレッドコンテキスト切り替え実装と qemu-virt64-riscv のテスト設定を見つけます。既存の FPU 状態がどのように扱われているかを読み、次に mstatus.FS と mstatus.VS、および RT_USING_RVV の設定境界を調査します。完了条件は、FP と RVV の状態を lazy に扱えること、vector スレッドと plain スレッドを混在させたテストで破損が発生しないこと、single-hart システム向けにコンテキスト切り替え前後のベンチマークがあることです。
索引モデルが issue の本文から書いたものです。
説明
Affected area
Kernel
Hardware/BSP vendor
Not applicable / Other
Architecture
RISC-V
Describe problem solved by the proposed feature
On the RISC-V port, every context switch saves and restores the full FPU
state unconditionally, even for threads that never touch it. There is also
no support for the Vector (RVV) extension at all. Vector registers are not
part of the thread context right now, so any thread using V instructions
would have its state silently corrupted by a context switch. Both gaps are
noted in #10722.
Describe your preferred solution
Make extension state save and restore lazy instead of unconditional, using
the mstatus.FS and mstatus.VS dirty bits the hardware already provides.
- Only save and restore FP state when a thread has actually used it since
its last switch (FS dirty bit), instead of doing it on every switch. - Add RVV 1.0 vector register state to the thread context, saved and
restored the same lazy way using the VS bit, behind an RT_USING_RVV
Kconfig option so boards without V are not affected. - Add tests on qemu-virt64-riscv with vector using threads mixed with
plain threads to catch any state corruption. - Benchmark context switch cost before and after.
I want to keep the scope to a single hart for now. SMP correctness, full
RVA23 compliance, and a generic extension discovery API can be natural
follow ups later, so this stays achievable as an OSPP 2026 project.
This is a project idea I want to propose for OSPP 2026, along with this
solution. Happy to hear if this is useful to the community or if someone
is already working on something similar.
Describe possible alternatives
No response
- 主要言語
- C
- スター
- 12.3k
- フォーク
- 5.5k
- 平均マージ
- 4日 12時間
- マージ済み PR(30日)
- 32
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RT-Thread/rt-thread のほかの issue
-
[Bug] [netdev] ping crashes the shell with a division by zero when the target is unreachable (received == 0)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug Component component: net
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
RT-Thread/rt-thread#11852 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[bsp][stm32][bluepill] README「快速上手」缺少重新生成 MDK 工程这一步,按文档操作无法编译通过対応中かも @moment-NEW が 3 日前に担当しました。 オープンin progress
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RT-Thread/rt-thread#11818 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
BSP BSP: Loongson bug RT-Smart
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RT-Thread/rt-thread#11717 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Arch: RISC-V BSP BSP: HPMicro bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
RT-Thread/rt-thread#11687 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
RT-Thread/rt-thread#11472 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
RT-Thread/rt-thread の issue をすべて見る
似ている issue
-
area:http-gateway good first issue priority:low type:docs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
crazy-goat/php-fpm-ng#828 ·
メンテナーはふだん 1 日以内に返信
-
area:docs good first issue type:docs
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
CVE-2026-18839 popt: size_t underflow in `singleOptionHelp`対応中かも @pmatilai が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
rpm-software-management/popt#143 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100