Skip to content

Commit 45cdfa6

Browse files
jtg-googlesleffler
authored andcommitted
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
1 parent f4aa444 commit 45cdfa6

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

apps/system/components/kata-os-common/src/scheduling/src/lib.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44

55
/// Scheduling domains configured for seL4 TCBs.
66
///
7-
/// Currently we have this setup as a pair of domains, one for the system
8-
/// components and another for the third party application sandbox.
7+
/// Currently we have this setup as a single domain for all components, since we
8+
/// don't want to waste 50% of our time waiting for a mostly idle partition.
9+
///
10+
/// TODO: Figure out how to more effectively use these domains of execution, and
11+
/// how to prevent wasting time in an idle thread for a whole domain when no
12+
/// TCBs are scheduled there. See also b/238811077.
913
///
1014
#[derive(Debug, Eq, PartialEq, Copy, Clone)]
1115
pub enum Domain {
1216
System = 0,
13-
AppSandbox,
1417
}

easy-settings.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ set(SIMULATION ON CACHE BOOL "Whether to build simulate script")
1414
set(RELEASE OFF CACHE BOOL "Performance optimized build")
1515
set(UseRiscVBBL OFF CACHE BOOL "Whether to use bbl")
1616

17-
set(KernelNumDomains 2 CACHE STRING "How many scheduling domains to build for")
17+
set(KernelNumDomains 1 CACHE STRING "How many scheduling domains to build for")
1818
set(KernelDomainSchedule "${CMAKE_CURRENT_LIST_DIR}/kernel/round_robin_domain.c" CACHE INTERNAL "Domain scheduler algorithm")

kernel/round_robin_domain.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@
1313
* other half. Note that even if there's nothing to run in the third-party
1414
* application domain, the scheduler will schedule an idle thread to ensure that
1515
* domain gets it's allocated share of time.
16+
*
17+
* TODO(jtgans,sleffler): Figure out how to better use these domains for
18+
* scheduling applications. We don't really want to use a full 50% duty cycle
19+
* for third party applications -- this wastes too much time. See also
20+
* b/238811077.
21+
*
22+
* NOTE: Only a single domain is currently enabled, as per the commented section
23+
* below. Any time the below schedule is changed, the number of domains
24+
* configured in easy-settings.cmake must also be changed.
1625
*/
1726
const dschedule_t ksDomSchedule[] = {
1827
{.domain = 0, .length = 1}, // System domain
19-
{.domain = 1, .length = 1}, // Third party application domain
28+
/* {.domain = 1, .length = 1}, // Third party application domain */
2029
};
2130

2231
const word_t ksDomScheduleLength = sizeof(ksDomSchedule) / sizeof(dschedule_t);

0 commit comments

Comments
 (0)