domains: Remove TPA sandbox domain for now

At the moment, the scheduler is wasting 50% of its time in an idle thread for
the application sandbox domain. Until we can figure out how to use these domains
more effectively, we'll reduce to a single domain.

Bug: 238811077
Change-Id: If40d01d5c94e31cc8d522dd5f906f857e363cc42
GitOrigin-RevId: 911f6fe046c61b8ce7e9ba00f8de0ec872997ec3
This commit is contained in:
June Tate-Gans 2022-08-01 13:35:13 -05:00 committed by Sam Leffler
parent 1b0f694aaf
commit c8e27dab0a
4 changed files with 19 additions and 7 deletions

View File

@ -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

View File

@ -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,
}

View File

@ -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")

View File

@ -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);