Use linked list in RRScheduler#5
Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes the Round-Robin scheduler by replacing VecDeque with an intrusive linked list (linked_list_r4l::List), improving theoretical performance from O(n) to O(1) for task removal operations. The implementation follows the same pattern used by FifoScheduler in the codebase.
Key Changes
- Added intrusive linked list support to
RRTaskby introducing alinksfield and implementing theGetLinkstrait - Replaced
VecDequewithlinked_list_r4l::ListinRRScheduler's ready queue - Simplified
remove_taskimplementation from O(n) iteration to O(1) linked list removal
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
You may provide a benchmark result for old |
equation314
left a comment
There was a problem hiding this comment.
Please wait for arceos-org/linked_list_r4l#5 to be merged.
|
ping @Mivik |
|
Perhaps we should release linked_list_r4l version 0.3.0 (maybe?) first. |
|
Yes, a version bump of linked_list_r4l is desired @equation314 |
|
@Mivik linked_list_r4l 0.3.0 is released now. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
The current round-robin scheduler uses a
VecDequeto store ready tasks, which is inefficient because all required operations can be performed in constant time using a linked list. This PR replacesVecDequewithlinked_list_r4l::List, thereby enhancing the scheduler's theoretical performance.Backward compatibility
The public interface remains unchanged.