|
Edited by jernej at 2016-1-8 17:03
I think I found out the reason for kswapd being on 100%. The main problem seems to be high percentage of memory reserved by ION. If you trace the code around ION, you can see that if CONFIG_CMA is enabled, there is actually no carveout memory but instead is transfered to CMA and here is the catch. ION and CMA didn't exist in linux 3.4, they were backported or taken from patches. While ION seems to be just some small optional driver, CMA is not. It is integrated deeply in DMA and other memory management code. And here lays the problem. Changing memory management code is very hard. Because of that, even in newer linux version there are still problems with CMA when you assign relatively high amount of memory to it:
https://lwn.net/Articles/636234/
https://lwn.net/Articles/619865/
https://lwn.net/Articles/633101/
Main advantage of CMA is that reserved memory can still be used by the system if it is not allocated, so when you are calling "free" command, you can see whole amount of memory available, including that reserved amount. However, CMA code version is one of the earliest, so there is potentially a lot of problems with it. Even the newest version still don't cooperate with kswapd efficiently (as can be read in articles mentioned before). My proposed fix is to disable CONFIG_CMA in config file and live by the fact that system uses only 768MB of it and the rest (256MB) is used explicitly for multimedia (display driver, CedarX and camera). That way kswapd stays at confortable 0% of CPU usage and even kodi seems to work faster (lower CPU load). Lower CPU load means also a lot less heat. Actually, my board with heatsink is barely warm during movie playback.
Can someone test my findings? |
|