Skip to contentSkip to conversation

suspend/resume performance improvement

RFC PATCH EunTaik Lee 1 participant 1 message May 27, 2015

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Pavel Machek
Quoted 3 lines

So, instead of depending on a userspace task's time slice, let kworker do the work to avoid a long wait on the runqueue.

...so if you really want high priority for that operation, just renice yourself to higher priority or something...

The problem occured on Android L version. KK had autosuspend enabled but it was disabled in L to allow userspace to collect stats.

The delay was inside try_to_freeze_tasks function (at system_server thread of system_server process). system_server got preempted after unlocking the tasklist_lock.
46 while (true) {

 47                 todo = 0;
 48                 read_lock(&tasklist_lock);
 49                 for_each_process_thread(g, p) {

50 if (p == current || !freeze_task(p))
51 continue;
52
53 if (!freezer_should_skip(p))
54 todo++;
55 }
56 read_unlock(&tasklist_lock);

All of the threads of system_server process that was on the runqueue did not run during this period. Freezing of tasks resumed after other tasks went out of the runqueue.

I have tested with the lowest nice value but the problem was still, although less, reproducible.

Best Regards,
Euntaik Lee