Re: Re: [RFC PATCH] suspend/resume performance improvement

From: EunTaik Lee
Date: Wed May 27 2015 - 06:38:23 EST



On Tue 2015-05-27 16:50 (GMT+09:00), Pavel Machek wrote:

>> 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