[Feature Request] Defer RISC-V callee-saved register handling on no-switch timer interrupts
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- c
- Lĩnh vực
- embedded-iot, operating-systems
Hướng nghiên cứu
Start from the RISC-V timer interrupt entry and the xTaskIncrementTick() call that decides whether a context switch happens, then read how the full integer context is saved and restored around vTaskSwitchContext(). Work is already under way in linked pull request #1482, so check that before starting. Done means the no-switch path saves only caller-saved registers, the switch path still saves s0-s11, and the QEMU M-mode test configurations pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
The GCC RISC-V port saves and restores the complete integer context on every
machine-timer interrupt, even when xTaskIncrementTick() returns pdFALSE.
On this no-switch path, saving s0-s11 is unnecessary because the RISC-V ABI
requires the called C functions to preserve them.
Describe the solution you'd like
Keep the existing task-frame layout, but split integer context handling into
caller-saved and callee-saved parts:
- Save caller-saved registers on timer entry.
- Call
xTaskIncrementTick(). - On
pdFALSE, restore caller-saved registers and return. - On
pdTRUE, saves0-s11into their reserved frame slots before
vTaskSwitchContext(), then use the existing full restore path.
Other trap and yield paths remain unchanged. FPU, vector, and chip-specific
additional contexts retain their current behavior.
For RV64, the no-switch path avoids 12 sd and 12 ld instructions, reducing
stack traffic by 192 bytes per tick.
Describe alternatives you've considered
Keeping the current full save is simpler but performs unnecessary memory
traffic on the common no-switch path. A separate short interrupt frame would
require larger changes to the existing frame ABI.
Additional context
Validated with:
- QEMU M-mode: no-switch, task-switch, FPU, vector, additional-context, and
combined configurations. - JH7110/U74 M-mode hardware: baseline and optimized versions both passed
single-task and two-task tests for 1,000,000 ticks. - 10,000 hardware no-switch samples:
- median: 59 → 50 cycles
- mean: 155.281 → 144.746 cycles
P99 and maximum did not improve.
If the approach is acceptable, I can submit a focused two-commit PR:
a context-helper refactor followed by the timer-path optimization.
How many devices will this feature impact?
Generic GCC RISC-V M-mode port; currently validated on one JH7110 board.
What are your project timelines?
Implementation and validation are complete. A PR can be submitted after
maintainer feedback.
- Ngôn ngữ chính
- C
- Star
- 4.6k
- Fork
- 1.6k
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FreeRTOS/FreeRTOS-Kernel
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
FreeRTOS/FreeRTOS-Kernel#1542 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[BUG] Release asset FreeRTOS-KernelV11.3.2.zip has the files of main, not of the tag V11.3.2Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
FreeRTOS/FreeRTOS-Kernel#1520 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
FreeRTOS/FreeRTOS-Kernel#1494 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
FreeRTOS/FreeRTOS-Kernel#1554 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
[BUG] event_wait_timed can't return falseCó thể đã có người làm @TedLyngmo đã nhận 39 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 38/100
FreeRTOS/FreeRTOS-Kernel#1546 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của FreeRTOS/FreeRTOS-Kernel
Issue tương tự
-
RecompLauncher supportĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
shinyquagsire23/OpenJKDF2#540 ·
Maintainer thường phản hồi trong vòng 12 ngày
-
Prison work hall: laundry and kitchen stations stand at bare walls, the hatch has no counter or signĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Life-Framework/Life-Framework#5939 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
autoconf failes to find libsodium even when present due to implicit function declarationCó thể đã có người làm @coderjoe đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 13 ngày
-
SessionInterfaceHandler is throwing a deprecation notice as a warning instead of a deprecationĐang mởBug Status: Needs Triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement_package: a site operand of another JSON type raises TypeError, not a named refusalĐang mởbug python
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Jstar269/nakagawa-recomp#3521 ·
Maintainer thường phản hồi trong vòng 1 ngày