Patch sched rust#139
Merged
fslongjin merged 24 commits intoDragonOS-Community:masterfrom Jan 14, 2023
Merged
Conversation
fslongjin
requested changes
Jan 10, 2023
kernel/src/process/proc-types.h
Outdated
| long pid; | ||
| long priority; // 优先级 | ||
| int64_t virtual_runtime; // 虚拟运行时间 | ||
| int64_t time_slice; |
kernel/src/sched/rt.h
Outdated
| * | ||
| */ | ||
| void sched_rt_init(struct rt_rq *rt_rq); | ||
| void init_rt_rq(struct rt_rq *rt_rq); |
kernel/src/sched/rt.rs
Outdated
| res = self.queue.pop().unwrap(); | ||
| } else { | ||
| // 如果队列为空,则返回IDLE进程的pcb | ||
| res = unsafe { &mut initial_proc_union.pcb }; |
kernel/src/sched/rt.rs
Outdated
| for i in 0..SchedulerRT::MAX_RT_PRIO { | ||
| let cpu_queue_i: &mut RTQueue = self.cpu_queue[i as usize]; | ||
| let proc: &'static mut process_control_block = cpu_queue_i.dequeue(); | ||
| if proc.policy != SCHED_NORMAL { |
kernel/src/sched/rt.rs
Outdated
| } | ||
| // curr优先级更大,说明一定是实时进程,则减去消耗时间片 | ||
| else { | ||
| current_pcb().time_slice -= 1; |
Member
There was a problem hiding this comment.
sched_update_jiffies里面已经更新了时间片了哦
2a92862 to
6958b92
Compare
fslongjin
requested changes
Jan 14, 2023
| self.lock.lock(); | ||
| if self.queue.len() > 0 { | ||
| // 队列不为空,返回下一个要执行的pcb | ||
| res = Some(self.queue.pop().unwrap()); |
fslongjin
approved these changes
Jan 14, 2023
fslongjin
added a commit
that referenced
this pull request
Jan 16, 2023
* Patch sched rust (#139) * update * 添加rt调度器的rust初步实现 * 完善rt调度逻辑 * 调试rt调度器 * 修改sched的返回值 * cargo fmt 格式化 * 删除无用代码,修补rt bug * 删除无用的代码,和重复的逻辑 * 软中断bugfix * 删除一些代码 * 添加kthread_run_rt文档 * 解决sphinix警告_static目录不存在的问题 Co-authored-by: longjin <longjin@RinGoTek.cn> * Raw spin lock 增加lock_irqsave、unlock_irqrestore(#151) Raw spin lock 增加lock_irqsave、unlock_irqrestore Co-authored-by: kong <45937622+kkkkkong@users.noreply.github.com> Co-authored-by: Gou Ngai <94795048+AlbertSanoe@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.