重写调度模块 (#679)

## PR:重写调度模块
--- 
### 完成的部分
- 实现cfs调度策略
- 搭建框架,后续功能可以迭代开发
- 目前能跑,未测试性能

### 需要后续接力的部分
- 实现组内调度(task_group)
- 实现跨核负载均衡(pelt算法)
- 接入sysfs,实现参数动态调节(sched_stat等)
- nice值以及priority等参数的设置及调优
This commit is contained in:
GnoCiYeH
2024-04-05 17:54:48 +08:00
committed by GitHub
parent e8eab1ac82
commit f0c87a897f
44 changed files with 3733 additions and 1066 deletions

View File

@ -1,5 +1,5 @@
use crate::{
arch::{sched::sched, CurrentIrqArch},
arch::CurrentIrqArch,
exception::InterruptArch,
filesystem::vfs::{
core::generate_inode_id, file::FileMode, syscall::ModeType, FilePrivateData, FileSystem,
@ -11,6 +11,7 @@ use crate::{
},
net::event_poll::{EPollEventType, EPollItem, EventPoll},
process::ProcessState,
sched::{schedule, SchedMode},
time::TimeSpec,
};
@ -197,7 +198,7 @@ impl IndexNode for LockedPipeInode {
self.read_wait_queue.sleep_without_schedule();
drop(irq_guard);
}
sched();
schedule(SchedMode::SM_NONE);
inode = self.inner.lock();
}
@ -354,7 +355,7 @@ impl IndexNode for LockedPipeInode {
self.write_wait_queue.sleep_without_schedule();
drop(irq_guard);
}
sched();
schedule(SchedMode::SM_NONE);
inode = self.inner.lock();
}