The issue we found in our application environment:
CPU usage of most applications increased 1.5-2 times when 4 cameras pipeline are connected into our system.
Investigation:
After some investigation, we found that maybe the root cause is "The growth of DDR bandwidth affects application CPU usage, especially for the DDR consumer process".
Then we do the experiment: Create a DDR consumer application which memcpy 256MB data every 1s, we call it ddr_consumer. Then we run the TIDL demo run_app_tidl_seg_16bit.sh which consumes 40% DDR bandwidth. The CPU usage of the ddr_consumer increases from 4% to 8%.
#include<unistd.h> #include<stdio.h> #include<stdlib.h> #include<signal.h> #include<string.h> #define BUFFER_SIZE (256*1024*1024) void *src,*dst; void memory_copy() { static int count = 0; memcpy(dst, src, BUFFER_SIZE); alarm(1); } int main(char argc, char* argv[]) { int i = 0; src= malloc(BUFFER_SIZE); dst = malloc(BUFFER_SIZE); signal(SIGALRM, memory_copy); alarm(1); for(i = 0 ; i < 100; i++) { sleep(1); } free(src); free(dst); return 0; }
Our question:
- Is this an expected phenomenon?
- The A72 cpu isn't enough to use in our automotive drive application, so the cpu load increasing in 1.5 times will make our system crash. How can we improve the situation? Can we raise a72 priority of accessing DDR?