Files
moss-kernel/Cargo.toml
Matthew Leach 5ebfc29cd2 sched: introduce Work as the unified scheduleable unit
Refactor the scheduler so all scheduleable work is wrapped in Arc<Work>,
replacing the previous per-CPU wait_q design where sleeping tasks were
bound to a specific CPU. Wakers now hold direct Arc<Work> references and
can re-enqueue tasks on any CPU upon wakeup.

Key changes:

- Add Work struct wrapping OwnedTask with an AtomicTaskState and
  scheduler metadata (SchedulerData), replacing the old SchedulableTask.
  Remove Task::state (Arc<SpinLock<TaskState>>). Work::state is now the
  single source of truth for task state.

- Rewrite the run queue using BinaryHeap-based eligible/ineligible split
  (EEVDF) with a dedicated VClock, replacing the BTreeMap linear scan.
  Extract vclock into its own module.

- Rewrite wakers to hold Arc<Work> directly instead of looking up tasks
  by TaskDescriptor from TASK_LIST.

- Replace lock-based sleep transitions in uspc_ret with atomic CAS
  (try_sleep_current) that correctly detects concurrent Woken state.

- Simplify least-tasked-CPU metric to use only run-queue weight, since
  sleeping tasks are no longer bound to any CPU.

- Add current_work() accessor.
2026-03-12 10:53:22 +00:00

66 lines
1.9 KiB
TOML

[workspace]
members = ["libkernel", "moss-macros", "usertest"]
[workspace.dependencies]
async-trait = "0.1.89"
bitflags = "2.11"
log = "0.4"
paste = "1.0.15"
rand = { version = "0.10", default-features = false }
[workspace.lints.clippy]
semicolon_if_nothing_returned = "warn"
uninlined_format_args = "warn"
[package]
name = "moss"
version = "0.1.0"
edition = "2024"
[[bin]]
name = "moss"
test = true
bench = false
[dependencies]
libkernel = { path = "libkernel" }
moss-macros = { path = "moss-macros" }
aarch64-cpu = "11.1.0"
arm-pl011-uart = { version = "0.5.0", default-features = false }
arm_pl031 = { version = "0.2.1", default-features = false }
async-trait = { workspace = true }
bitflags = { workspace = true }
blake2 = { version = "0.10.6", default-features = false }
chacha20 = { version = "0.10.0", default-features = false, features = ["rng"] }
fdt-parser = "0.4.16"
futures = { version = "0.3.31", default-features = false, features = ["alloc", "async-await"] }
getargs = { version = "0.5.0", default-features = false }
log = { workspace = true }
object = { version = "0.38.0", default-features = false, features = ["core", "elf", "read_core"] }
paste = { workspace = true }
ringbuf = { version = "0.4.8", default-features = false, features = ["alloc"] }
rand = { workspace = true }
rustc-hash = { version = "2.1", default-features = false }
smoltcp = { version = "0.12.0", default-features = false, features = ["alloc", "medium-ethernet", "medium-ip", "proto-ipv4", "proto-ipv6", "socket-tcp", "socket-udp"] }
tock-registers = "0.10.1"
virtio-drivers = "0.13.0"
atomic_enum = "0.3.0"
[build-dependencies]
time = { version = "0.3.47", features = ["formatting", "macros"] } # For build timestamping via build.rs
[features]
default = ["smp"]
# Support for Symmetric Multiprocessing
smp = []
[profile.release]
debug = "full"
opt-level = 3
codegen-units = 1
[lints]
workspace = true