diff --git a/apps/system/components/ProcessManager/kata-proc-manager/src/sel4bundle/mod.rs b/apps/system/components/ProcessManager/kata-proc-manager/src/sel4bundle/mod.rs index e3f3085..d5248da 100644 --- a/apps/system/components/ProcessManager/kata-proc-manager/src/sel4bundle/mod.rs +++ b/apps/system/components/ProcessManager/kata-proc-manager/src/sel4bundle/mod.rs @@ -292,8 +292,8 @@ impl seL4BundleImpl { cap_tcb: CSpaceSlot::new(), // Top-level dup for suspend/resume first_page: first_vaddr / PAGE_SIZE, - affinity: 0, // CPU 0 - domain: Domain::AppSandbox, + affinity: 0, // CPU 0 + domain: Domain::System, // TODO(jtgans,sleffler): Figure out how to use this correctly. b/238811077 tcb_name: bundle.app_id.clone(), tcb_max_priority: 254, // TODO(sleffler): guess diff --git a/apps/system/components/kata-os-common/src/scheduling/src/lib.rs b/apps/system/components/kata-os-common/src/scheduling/src/lib.rs index ece2599..d8a04f2 100644 --- a/apps/system/components/kata-os-common/src/scheduling/src/lib.rs +++ b/apps/system/components/kata-os-common/src/scheduling/src/lib.rs @@ -4,11 +4,14 @@ /// Scheduling domains configured for seL4 TCBs. /// -/// Currently we have this setup as a pair of domains, one for the system -/// components and another for the third party application sandbox. +/// Currently we have this setup as a single domain for all components, since we +/// don't want to waste 50% of our time waiting for a mostly idle partition. +/// +/// TODO: Figure out how to more effectively use these domains of execution, and +/// how to prevent wasting time in an idle thread for a whole domain when no +/// TCBs are scheduled there. See also b/238811077. /// #[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum Domain { System = 0, - AppSandbox, } diff --git a/easy-settings.cmake b/easy-settings.cmake index 0e160d8..780ac86 100644 --- a/easy-settings.cmake +++ b/easy-settings.cmake @@ -14,5 +14,5 @@ set(SIMULATION ON CACHE BOOL "Whether to build simulate script") set(RELEASE OFF CACHE BOOL "Performance optimized build") set(UseRiscVBBL OFF CACHE BOOL "Whether to use bbl") -set(KernelNumDomains 2 CACHE STRING "How many scheduling domains to build for") +set(KernelNumDomains 1 CACHE STRING "How many scheduling domains to build for") set(KernelDomainSchedule "${CMAKE_CURRENT_LIST_DIR}/kernel/round_robin_domain.c" CACHE INTERNAL "Domain scheduler algorithm") diff --git a/kernel/round_robin_domain.c b/kernel/round_robin_domain.c index a0d10a2..fdea130 100644 --- a/kernel/round_robin_domain.c +++ b/kernel/round_robin_domain.c @@ -13,10 +13,19 @@ * other half. Note that even if there's nothing to run in the third-party * application domain, the scheduler will schedule an idle thread to ensure that * domain gets it's allocated share of time. + * + * TODO(jtgans,sleffler): Figure out how to better use these domains for + * scheduling applications. We don't really want to use a full 50% duty cycle + * for third party applications -- this wastes too much time. See also + * b/238811077. + * + * NOTE: Only a single domain is currently enabled, as per the commented section + * below. Any time the below schedule is changed, the number of domains + * configured in easy-settings.cmake must also be changed. */ const dschedule_t ksDomSchedule[] = { {.domain = 0, .length = 1}, // System domain - {.domain = 1, .length = 1}, // Third party application domain + /* {.domain = 1, .length = 1}, // Third party application domain */ }; const word_t ksDomScheduleLength = sizeof(ksDomSchedule) / sizeof(dschedule_t);