DSU service: Pipeline the installation task to improve performance
Right now the installation task does roughly this:
while (has partition data left) {
a. Copy partition data to write buffer.
b. Copy write buffer to shared memory.
c. Binder call submitFromAshmem() to inform the consumer of the
shared memory.
}
Both task (a) and (c) are I/O intensive and time consuming operations.
However (a) and (c) don't have a strong data dependency, and the only
consistency condition we need to maintain is "task (b) can only be
started once task (c) from the previous iteration is complete."
As soon as (b) is complete, (c) and *(a) of the next iteration* can be
started, pipelining task (a) & (c).
Also enlarge the default shared memory size because there are new
improvements after this change. The new default size (512K) is chosen
somewhat randomly, it's large enough to optimize the installation time
and small enough to not starve most devices' RAM.
Speedup:
* physical device: 23s -> 18s (14s if shared memory buffer is 512K)
* virtual device: 19s -> 15s
Bug: 225310919
Test: Install and boot DSU
Change-Id: If7093919762861d19d4fecaf997a699cc1b0fe41
1 file changed