Skip to content
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

Merged
merged 29 commits into from
Feb 4, 2023
Merged

Io scheduler #158

merged 29 commits into from
Feb 4, 2023

Conversation

houmkh
Copy link
Collaborator

@houmkh houmkh commented Jan 19, 2023

No description provided.

@fslongjin fslongjin requested a review from guanjinquan January 19, 2023 15:30
@@ -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();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数改名为completion_alloc

@@ -136,7 +137,9 @@ static int ahci_init_gendisk()
}
}
}

kdebug("part_cnt = %d", ahci_gendisk0.part_cnt);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里还有kdebug

@@ -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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个kdebug需要山了

CFLAGS += -I .


kernel_process_objs:= $(shell find ./*.c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

名字改成kernel_io_objs

*/
void io_scheduler_init(){
io_scheduler_init_rust();
kthread_run(&address_requests,NULL,"io_scheduler",NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码没有格式化

@@ -0,0 +1,8 @@
#pragma once

extern void address_requests();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数名有歧义,然后,导出到c的函数,请以io_sched_开头这样

}
}

pub fn switch_c_ahci_request(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convert更合适


#[no_mangle]
/// @brief 处理请求
pub extern "C" fn address_requests() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改函数名

@@ -499,6 +500,7 @@ ul initial_kernel_thread(ul arg)

scm_enable_double_buffer();


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

初始化调度器在哪个位置?

Copy link
Member

@fslongjin fslongjin left a 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不用pub

fslongjin and others added 8 commits January 30, 2023 14:18
2、增加kick_cpu功能,支持让某个特定核心立即运行调度器
3、wait_queue的唤醒,改为立即唤醒。
4、增加进程在核心间迁移的功能
5、CFS调度器为每个核心设置单独的IDLE进程pcb(pid均为0)
6、pcb中增加migrate_to字段
7、当具有多核时,io调度器在核心1上运行。
@@ -2,7 +2,7 @@
CFLAGS += -I .


kernel_io_objs:= $(shell find ./*.c)
kernel_io_objs:= $(shell find ./*.c ./*/*.c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要这样写,应当在block文件夹下面,新建一个Makefile

@fslongjin fslongjin merged commit f6ba114 into DragonOS-Community:master Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants