-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Io scheduler #158
Io scheduler #158
Conversation
kernel/src/common/completion.h
Outdated
@@ -30,7 +30,7 @@ long wait_for_completion_interruptible_timeout(struct completion *x, long timeou | |||
void wait_for_multicompletion(struct completion x[], int n); | |||
bool try_wait_for_completion(struct completion *x); | |||
bool completion_done(struct completion *x); | |||
|
|||
struct completion* get_completion(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数改名为completion_alloc
kernel/src/driver/disk/ahci/ahci.c
Outdated
@@ -136,7 +137,9 @@ static int ahci_init_gendisk() | |||
} | |||
} | |||
} | |||
|
|||
kdebug("part_cnt = %d", ahci_gendisk0.part_cnt); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里还有kdebug
kernel/src/filesystem/MBR.c
Outdated
@@ -13,5 +13,6 @@ struct MBR_disk_partition_table_t MBR_partition_tables[MBR_MAX_AHCI_CTRL_NUM][MB | |||
*/ | |||
int MBR_read_partition_table(struct blk_gendisk *gd, void *buf) | |||
{ | |||
kdebug("gd = %#018lx",gd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个kdebug需要山了
kernel/src/io/Makefile
Outdated
CFLAGS += -I . | ||
|
||
|
||
kernel_process_objs:= $(shell find ./*.c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
名字改成kernel_io_objs
kernel/src/io/scheduler.c
Outdated
*/ | ||
void io_scheduler_init(){ | ||
io_scheduler_init_rust(); | ||
kthread_run(&address_requests,NULL,"io_scheduler",NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
代码没有格式化
kernel/src/io/scheduler.h
Outdated
@@ -0,0 +1,8 @@ | |||
#pragma once | |||
|
|||
extern void address_requests(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
函数名有歧义,然后,导出到c的函数,请以io_sched_
开头这样
kernel/src/io/scheduler.rs
Outdated
} | ||
} | ||
|
||
pub fn switch_c_ahci_request( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
convert
更合适
kernel/src/io/scheduler.rs
Outdated
|
||
#[no_mangle] | ||
/// @brief 处理请求 | ||
pub extern "C" fn address_requests() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改函数名
kernel/src/process/process.c
Outdated
@@ -499,6 +500,7 @@ ul initial_kernel_thread(ul arg) | |||
|
|||
scm_enable_double_buffer(); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
初始化调度器在哪个位置?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
@@ -25,6 +25,7 @@ mod ipc; | |||
#[macro_use] | |||
mod libs; | |||
mod exception; | |||
pub mod io; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不用pub
2、增加kick_cpu功能,支持让某个特定核心立即运行调度器 3、wait_queue的唤醒,改为立即唤醒。 4、增加进程在核心间迁移的功能 5、CFS调度器为每个核心设置单独的IDLE进程pcb(pid均为0) 6、pcb中增加migrate_to字段 7、当具有多核时,io调度器在核心1上运行。
kernel/src/io/Makefile
Outdated
@@ -2,7 +2,7 @@ | |||
CFLAGS += -I . | |||
|
|||
|
|||
kernel_io_objs:= $(shell find ./*.c) | |||
kernel_io_objs:= $(shell find ./*.c ./*/*.c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不要这样写,应当在block文件夹下面,新建一个Makefile
No description provided.