Scheduler core — schedule(), tick, init, work-stealing, softirq, nohz. More...
import drivers.watchdog.core;import lib.cpumask;import lib.softirq.core;import lib.error;import arch.s390x.cpu.cputimer;import zxfoundation.base.typestate;import zxfoundation.base.types;import zxfoundation.dgp.gate.core;import zxfoundation.dgp.domain.types;import zxfoundation.dgp.isolation;import zxfoundation.sys.irq.core;import arch.s390x.cpu.lowcore;import zxfoundation.sched.cpupri.core;import zxfoundation.sched.rt.bandwidth;import zxfoundation.dgp.domain.core;import zxfoundation.sched.cpudl.core;import zxfoundation.sched.smt.core;import zxfoundation.dgp.signal;import zxfoundation.sync.qspinlock.core;import zxfoundation.sched.numa.core;import zxfoundation.sched.nohz.core;import arch.s390x.cpu.processor;import zxfoundation.memory.numa.types;import lib.rbtree;import zxfoundation.sched.pelt.core;import zxfoundation.sched.sd.types;import zxfoundation.sched.softirq.core;import zxfoundation.sched.entity;import zxfoundation.scoms.kobject.types;import zxfoundation.sys.timer.types;import zxfoundation.sched.topology.core;import lib.format;import zxfoundation.sched.sd.core;import zxfoundation.sched.idle;import arch.s390x.cpu.cpumask;import arch.s390x.cpu.irq;import zxfoundation.sched.topology.types;import zxfoundation.base.config;import zxfoundation.sched.strandctx.core;import zxfoundation.sched.balance.core;import zxfoundation.sys.syschk.core;import zxfoundation.sched.fair.core;import zxfoundation.sched.policy;import zxfoundation.sched.rq_snapshot.core;import zxfoundation.sched.classed.core;import zxfoundation.sched.context.core;import zxfoundation.scoms.kobject.ref;import lib.container_of;import zxfoundation.sys.time.core;import arch.s390x.cpu.ctlreg;import arch.s390x.cpu.ar;import zxfoundation.dgp.isolation.types;import arch.s390x.cpu.clock;import zxfoundation.sched.cbs.core;import zxfoundation.dgp.sync_contract;import zxfoundation.sched.rt.core;import zxfoundation.memory.hhdm;import zxfoundation.sys.printk.core;import zxfoundation.dgp.portal;import zxfoundation.sys.timer.core;import zxfoundation.sys.irq.consts;import zxfoundation.sched.admit.core;import arch.s390x.cpu.ipi;import zxfoundation.smp.csd.core;import std;import lib.list;import zxfoundation.scoms.kobject.base;import arch.s390x.cpu.aste;import arch.s390x.cpu.psw;Data Structures | |
| struct | zxfoundation::sched::domain |
| The domain struct — the central entity of the DGP kernel. More... | |
| struct | zxfoundation::sched::run_queue |
| Per-CPU run queue — schedules strands (execution contexts). More... | |
| struct | zxfoundation::sched::sched_domain_tree |
Per-CPU sched_domain tree rooted at run_queue::sd. More... | |
| struct | zxfoundation::sched::strand |
| Strand — the DGP kernel's unit of schedulable execution. More... | |
Typedefs | |
| using | zxfoundation::sched::domain_id |
| Opaque domain identifier. | |
Enumerations | |
| enum class | zxfoundation::sched::domain_flags |
| Per-domain flags (bitfield). | |
| enum class | zxfoundation::sched::lifecycle_state |
| Unified lifecycle states for ALL typestate-tracked resources. More... | |
| enum class | zxfoundation::sched::sched_substate |
| Scheduler substate within the active lifecycle. | |
Functions | |
| auto | zxfoundation::sched::cpu_down (u16 cpu_id) noexcept -> ::std::expected< void, ::lib::kernel_error > |
| Notify the scheduler that a CPU is going offline. | |
| auto | zxfoundation::sched::cpu_rq (u16 cpu_id) noexcept -> run_queue & |
| auto | zxfoundation::sched::cpu_timer (u16 cpu_id) noexcept -> zxfoundation::sys::timer::kernel_timer & |
| Return the per-CPU periodic tick timer used by the nohz machinery. | |
| auto | zxfoundation::sched::cpu_timer_tick () noexcept -> void |
| CPU timer quantum enforcement — fires when a strand's quantum expires. | |
| auto | zxfoundation::sched::cpu_up (u16 cpu_id) noexcept -> ::std::expected< void, ::lib::kernel_error > |
| Notify the scheduler that a CPU has come online. | |
| declscope (C) auto sched_strand_trampoline_exit() noexcept -> void | |
| auto | zxfoundation::sched::dequeue_domain (domain *d) noexcept -> void |
| auto | zxfoundation::sched::dequeue_strand (strand *s) noexcept -> void |
| auto | zxfoundation::sched::domain_enter_user (strand *s) noexcept -> void |
| Enter user mode for a domain. | |
| auto | zxfoundation::sched::detail::domain_reap (domain &d) noexcept -> void |
| auto | zxfoundation::sched::enqueue_domain (domain *d) noexcept -> void |
| auto | zxfoundation::sched::enqueue_strand (strand *s) noexcept -> void |
| auto | zxfoundation::sched::idle_enter () noexcept -> void |
| auto | zxfoundation::sched::irq_handler_cpu_timer (u16 irq, arch::s390x::cpu::irq::irq_frame *frame, void *data) noexcept -> void |
| CPU timer IRQ handler — dispatches vector EXT_IRQ_CPU_TIMER. | |
| auto | zxfoundation::sched::need_resched () noexcept -> bool |
| auto | zxfoundation::sched::preempt_schedule () noexcept -> void |
| auto | zxfoundation::sched::quiesce_domain (domain &d) noexcept -> std::expected< void, lib::kernel_error > |
| Quiesce every strand owned by a domain before identity teardown. | |
| auto | zxfoundation::sched::detail::record_asce_attachment (domain &d) noexcept -> void |
| auto | zxfoundation::sched::sched_active () noexcept -> bool |
| auto | zxfoundation::sched::sched_init () noexcept -> void |
| auto | zxfoundation::sched::sched_init_ap (u16 cpu_id) noexcept -> void |
| auto | zxfoundation::sched::sched_resched_current () noexcept -> void |
| Mark the currently executing domain as needing rescheduling. | |
| auto | zxfoundation::sched::schedule () noexcept -> void |
| auto | zxfoundation::sched::scheduler_tick () noexcept -> void |
| Periodic scheduler tick. | |
| auto | zxfoundation::sched::detail::set_need_resched () noexcept -> void |
| auto | zxfoundation::sched::setup_primary_strand_context (domain *d, strand_entry_fn entry, void *arg) noexcept -> void |
| Convenience wrapper — kernel-thread first-switch for the primary strand of a domain. | |
| auto | zxfoundation::sched::setup_primary_strand_context_user (domain *d) noexcept -> void |
| Convenience wrapper — user-process first-switch for the primary strand of a domain. | |
| auto | zxfoundation::sched::setup_strand_context_kernel_thread (strand *s, strand_entry_fn entry, void *arg) noexcept -> void |
| Set up the initial kernel stack frame for a strand so that the. | |
| auto | zxfoundation::sched::setup_strand_context_user (strand *s, const user_regs *uregs, const domain *owner) noexcept -> void |
Set up the initial kernel stack frame for a strand whose first context switch performs an LPSWE into user mode. | |
| auto | zxfoundation::sched::strand_admit_policy (strand &s, const zxfoundation::sched::sched_policy &policy) noexcept -> std::expected< zxfoundation::sched::sched_admission_result, lib::kernel_error > |
| Admit a scheduler policy for a strand before run-queue insertion. | |
| auto | zxfoundation::sched::strand_spawn (const zxfoundation::dgp::domain::strand_create_request &request) noexcept -> std::expected< zxfoundation::dgp::domain::strand *, lib::kernel_error > |
| Create and optionally enqueue a secondary strand for a DGP domain. | |
| auto | zxfoundation::sched::strand_trampoline_exit () noexcept -> void |
| auto | zxfoundation::sched::this_rq () noexcept -> run_queue & |
| auto | zxfoundation::sched::detail::try_steal_strand_locked (run_queue &local_rq) noexcept -> strand * |
Hierarchical work stealing walking the sched_domain tree. | |
| auto | zxfoundation::sched::detail::validate_scheduler_irq_context (u32 domain_id=0U) noexcept -> void |
Variables | |
| no_export std::array< sys::timer::kernel_timer, zxfoundation::base::config::CONFIG_ZX_MAX_CPUS > | zxfoundation::sched::detail::g_ap_tick_timers {} |
| no_export sys::timer::kernel_timer | zxfoundation::sched::detail::g_bsp_tick_timer {} |
| no_export std::array< run_queue, zxfoundation::base::config::CONFIG_ZX_MAX_CPUS > | zxfoundation::sched::detail::g_rqs {} |
| no_export bool | zxfoundation::sched::detail::g_sched_initialized {false} |
Scheduler core — schedule(), tick, init, work-stealing, softirq, nohz.
SPDX-License-Identifier: Apache-2.0
|
strong |
Unified lifecycle states for ALL typestate-tracked resources.
Every SCOMS-managed object, every folio, and every slab cache uses exactly these states. No subsystem may define its own.
|
nodiscardexportnoexcept |
Notify the scheduler that a CPU is going offline.
| [in] | cpu_id | Logical CPU ID going offline. |
|
noexcept |
Enter user mode for a domain.
Enter user mode for a domain at runtime.
| s | Strand with valid body->uregs; domain accessed via s->owner. |
|
nodiscardexportnoexcept |
Quiesce every strand owned by a domain before identity teardown.
| [in] | d | Domain entering the dying state. |
|
noexcept |
Set up the initial kernel stack frame for a strand so that the.
| s | Target strand with valid kstack_top |
| entry | Non-null kernel entry function |
| arg | Opaque argument passed to entry in r2 |
|
noexcept |
Set up the initial kernel stack frame for a strand whose first context switch performs an LPSWE into user mode.
| s | Target strand with valid kstack_top and body->uregs already populated |
| uregs | Pointer to the user_regs snapshot |
| owner | The owning domain, used for ASC normalization and DGP isolation validation. |
|
nodiscardexportnoexcept |
Admit a scheduler policy for a strand before run-queue insertion.
| [in,out] | s | Strand receiving the policy metadata. |
| [in] | policy | Requested scheduler policy. |
|
nodiscardexportnoexcept |
Create and optionally enqueue a secondary strand for a DGP domain.
| [in] | request | Executor-style creation request selecting one of three strand kinds:
|
kernel_error if validation, allocation, or admission fails.entry != nullptr AND uregs != nullptr is rejected with invalid_arg. The bare mode requires enqueue == false.The kthread vs user split mirrors Linux copy_thread:
entry(arg) runs on the new strand's kernel stack and tail-calls sched_strand_trampoline_exit on return.uregs->psw_addr with uregs->psw_mask.| [in] | request | Executor-style creation request selecting one of three strand kinds (kernel-thread, user-process, bare). See zxfoundation::dgp::domain::strand_create_request for the full duality documentation. |
|
noexcept |
Hierarchical work stealing walking the sched_domain tree.
| [in,out] | local_rq | The idle CPU's run queue (lock held on entry). |
se.vruntime is normalized to the local run queue's min_vruntime;