mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
ke: scheduler overhaul
This commit is contained in:
+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