Android presently uses memory cgroups for more swapping of cached apps. But 
when we enable memory cgroup from kernel, we see user experience is 
sluggish. Digging more into this, I found that, most of the time spent by 
CPU is on charge migration from one cgroup to another. In addition, the 
design of charge migration is not meant for very frequent task migration 
across the cgroups (like what Android expects). Mem cgroup takes global 
lock and migrates one task completely. If there are n-tasks waiting to be 
migrated, n-th task will starve the most. Now, for each task, charge 
migration happens on per-page basis. So, if the app is in order of 40-50 
MB, 10K page migration routines will be invoked for just one process.

Problem gets even worse in Android context. Android maintains 2 groups. 
root and sw. In simple words, root contains process of higher importance 
and sw contains mostly cached processes. Now, when one process comes to 
foreground from cached group, and in parallel some processes are migrated 
to sw group, memcgroup will exhaust and sometimes gives worst timing for 
the process coming to foreground. This hugely affects the user experience.

2 questions,

(1) Did anyone faced this issue ?
(2) If yes, any idea to resolve this ?

-- 
-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel
--- 
You received this message because you are subscribed to the Google Groups 
"Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-kernel+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to