Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit c279f2b8 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Fix job concurrency calculation

- Originally, we had two parameters "total active jobs=6" and "max FG jobs=4",
but because of how we counted jobs against those, sometimes we ran at most 6
jobs and sometimes 10, depending on how pending jobs are queued. Now we made it
consistent.

- The new parameters that control it are:
 1. Max total jobs
 2. Max BG jobs
 3. Min BG jobs
    * This is used to ensure a certain number of BG jobs should run
      even when the TOP app keeps scheduling new jobs and consume
      the max total jobs.
 (4. Screen off rampup delay.)

We have these 3 values for each "memory trim level" and "screen on/off".
The intention is that when the screen is off, we should run more jobs. However,
when the screen is off, we don't increase the concurrency right away, but
we'll do so after the rampup delay.

- The current max values are based on the lenient side of the previous values,
but with a slightly lowered the max job count when the screen is on.

Under NOTMAL memory trim level, when the screen is ON:
 * 8 total jobs, 6 max BG jbos.

Under NOTMAL memory trim level, when the screen is OFF:
 * 10 total jobs, 6 max BG jbos.

Bug: 111360323
Test: Manual test using "adb shell requestsync"
Test: atest JobCountTrackerTest MaxJobCountsTest
Test: atest CtsJobSchedulerTestCases  (following failed; all known issues)
android.jobscheduler.cts.BatteryConstraintTest#testBatteryNotLowConstraintFails_withoutPower
android.jobscheduler.cts.BatteryConstraintTest#testChargingConstraintExecutes
android.jobscheduler.cts.ConnectivityConstraintTest#testConnectivityConstraintExecutes_metered
android.jobscheduler.cts.ConnectivityConstraintTest#testConnectivityConstraintExecutes_withMobile
android.jobscheduler.cts.ConnectivityConstraintTest#testUnmeteredConstraintFails_withMobile
android.jobscheduler.cts.JobThrottlingTest#testBackgroundConnectivityJobsThrottled

Change-Id: I0a9de5832b946cb1cac8a69aedbb0cb59251ea47
parent 37e43a88
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment