mm+ke: make shootdowns use HandoffList

This commit is contained in:
Loïc Grégoire
2026-07-18 16:45:32 -04:00
parent d21cefaf10
commit 782196275b
3 changed files with 20 additions and 19 deletions
-1
View File
@@ -19,7 +19,6 @@ pub fn init(boot_info: *r.BootInfo) linksection(r.init) void {
ki.log.init();
ki.cpu.init_cpu(0);
ki.turnstile.init_turnstiles();
ki.shootdown.init();
thread0.init(@intFromPtr(&stack), r.kib(16), ke.Thread.Priority.idle_low, ki.sched.idle, null);
thread0.priority = 0;
+3 -7
View File
@@ -14,7 +14,7 @@ pub const ShootdownState = struct {
/// This is used as a counter when the request is outstanding,
/// otherwise it is set to the `slot_*` values below.
state: std.atomic.Value(u16),
link: rtl.List.Entry,
link: ?*anyopaque,
/// Base virtual address of the shootdown.
base: r.VAddr,
/// Number of pages to flush.
@@ -42,7 +42,7 @@ const slot_free: u16 = std.math.maxInt(u16);
const slot_reserved: u16 = std.math.maxInt(u16) - 1;
const percpu = ke.CpuLocal(PerCpu, undefined);
pub var shootdowns: ke.Queue = undefined;
pub var shootdowns: rtl.HandoffList = undefined;
var sync_counter: std.atomic.Value(usize) = .init(0);
var sync_addr: r.VAddr = 0;
@@ -149,7 +149,7 @@ pub fn process_shootdowns() void {
flush_range(state.base, state.npages);
if (state.state.fetchSub(1, .release) == 1) {
shootdowns.insert(&state.link, .Tail);
shootdowns.insert(&state.link);
}
}
}
@@ -189,7 +189,3 @@ pub fn submit(state: ShootdownState, target_mask: ke.CpuMask) !void {
percpu.remote(@truncate(bit)).senders.set(curcpu, .release);
}
}
pub fn init() void {
shootdowns.init(ke.ncpus);
}