mirror of
https://github.com/rdmsr/zag.git
synced 2026-11-01 07:48:20 +00:00
ke: scheduler overhaul
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@ pub fn init() void {
|
||||
console_list.init();
|
||||
|
||||
const td = ps.thread.create_kernel(
|
||||
ke.Thread.Priority.default,
|
||||
.Default,
|
||||
worker,
|
||||
null,
|
||||
) catch @panic("handle me");
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ pub fn init() void {
|
||||
if (rtl.cmdline.get_string(cline, "test")) |tst| {
|
||||
// Run a test if specified.
|
||||
if (r.tests.tests.get(tst)) |func| {
|
||||
const t = ps.thread.create_kernel(ke.Thread.Priority.default, func, r.boot_info) catch @panic("oom");
|
||||
const t = ps.thread.create_kernel(.Default, func, r.boot_info) catch @panic("oom");
|
||||
ke.sched.enqueue(&t.kern);
|
||||
} else {
|
||||
std.log.info("invalid test: \"{s}\"", .{tst});
|
||||
@@ -35,6 +35,6 @@ pub fn init() void {
|
||||
}
|
||||
|
||||
if (r.boot_info.framebuffer != null) {
|
||||
// fbconsole.init(boot_info);
|
||||
// fbconsole.init(r.boot_info);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-5
@@ -50,11 +50,11 @@ pub const WorkItem = struct {
|
||||
/// High priority work.
|
||||
High,
|
||||
|
||||
pub fn to_sched_prio(prio: Priority) u8 {
|
||||
pub fn to_sched_prio(prio: Priority) ke.Thread.Priority {
|
||||
return switch (prio) {
|
||||
.Low => ke.Thread.Priority.low_batch,
|
||||
.Normal => ke.Thread.Priority.high_batch,
|
||||
.High => ke.Thread.Priority.low_realtime,
|
||||
.Low => .LowBatch,
|
||||
.Normal => .HighBatch,
|
||||
.High => .LowRealtime,
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -128,6 +128,8 @@ const Pool = struct {
|
||||
@ptrFromInt(ctx.value),
|
||||
);
|
||||
|
||||
td.kern.nice = -ke.Thread.Priority.nice_max;
|
||||
|
||||
if (cpu != null) {
|
||||
td.kern.last_cpu = cpu;
|
||||
td.kern.pinned = true;
|
||||
@@ -312,7 +314,7 @@ pub fn init() !void {
|
||||
try low.init(.Low, null);
|
||||
|
||||
var td = ps.thread.create_kernel(
|
||||
ke.Thread.Priority.default,
|
||||
.Default,
|
||||
pool_manager,
|
||||
null,
|
||||
) catch @panic("Failed to create pool manager");
|
||||
|
||||
Reference in New Issue
Block a user