mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-23 16:23:24 +00:00
重写调度模块 (#679)
## PR:重写调度模块 --- ### 完成的部分 - 实现cfs调度策略 - 搭建框架,后续功能可以迭代开发 - 目前能跑,未测试性能 ### 需要后续接力的部分 - 实现组内调度(task_group) - 实现跨核负载均衡(pelt算法) - 接入sysfs,实现参数动态调节(sched_stat等) - nice值以及priority等参数的设置及调优
This commit is contained in:
@ -11,7 +11,6 @@ use alloc::{
|
||||
use system_error::SystemError;
|
||||
|
||||
use crate::{
|
||||
arch::sched::sched,
|
||||
filesystem::vfs::{
|
||||
file::{File, FileMode},
|
||||
FilePrivateData, IndexNode, Metadata,
|
||||
@ -24,6 +23,7 @@ use crate::{
|
||||
wait_queue::WaitQueue,
|
||||
},
|
||||
process::ProcessManager,
|
||||
sched::{schedule, SchedMode},
|
||||
time::{
|
||||
timer::{next_n_us_timer_jiffies, Timer, WakeUpHelper},
|
||||
TimeSpec,
|
||||
@ -489,7 +489,7 @@ impl EventPoll {
|
||||
let guard = epoll.0.lock_irqsave();
|
||||
unsafe { guard.epoll_wq.sleep_without_schedule() };
|
||||
drop(guard);
|
||||
sched();
|
||||
schedule(SchedMode::SM_NONE);
|
||||
// 被唤醒后,检查是否有事件可读
|
||||
available = epoll.0.lock_irqsave().ep_events_available();
|
||||
if let Some(timer) = timer {
|
||||
|
@ -15,7 +15,7 @@ use smoltcp::{
|
||||
use system_error::SystemError;
|
||||
|
||||
use crate::{
|
||||
arch::{rand::rand, sched::sched},
|
||||
arch::rand::rand,
|
||||
filesystem::vfs::{
|
||||
file::FileMode, syscall::ModeType, FilePrivateData, FileSystem, FileType, IndexNode,
|
||||
Metadata,
|
||||
@ -25,6 +25,7 @@ use crate::{
|
||||
spinlock::{SpinLock, SpinLockGuard},
|
||||
wait_queue::EventWaitQueue,
|
||||
},
|
||||
sched::{schedule, SchedMode},
|
||||
};
|
||||
|
||||
use self::{
|
||||
@ -337,8 +338,9 @@ impl IndexNode for SocketInode {
|
||||
_offset: usize,
|
||||
len: usize,
|
||||
buf: &mut [u8],
|
||||
_data: SpinLockGuard<FilePrivateData>,
|
||||
data: SpinLockGuard<FilePrivateData>,
|
||||
) -> Result<usize, SystemError> {
|
||||
drop(data);
|
||||
self.0.lock_no_preempt().read(&mut buf[0..len]).0
|
||||
}
|
||||
|
||||
@ -347,8 +349,9 @@ impl IndexNode for SocketInode {
|
||||
_offset: usize,
|
||||
len: usize,
|
||||
buf: &[u8],
|
||||
_data: SpinLockGuard<FilePrivateData>,
|
||||
data: SpinLockGuard<FilePrivateData>,
|
||||
) -> Result<usize, SystemError> {
|
||||
drop(data);
|
||||
self.0.lock_no_preempt().write(&buf[0..len], None)
|
||||
}
|
||||
|
||||
@ -417,7 +420,7 @@ impl SocketHandleItem {
|
||||
.sleep_without_schedule(events)
|
||||
};
|
||||
drop(handle_map_guard);
|
||||
sched();
|
||||
schedule(SchedMode::SM_NONE);
|
||||
}
|
||||
|
||||
pub fn shutdown_type(&self) -> ShutdownType {
|
||||
|
Reference in New Issue
Block a user