freezer: skip waking up tasks with PF_FREEZER_SKIP set
authorColin Cross <ccross@android.com>
Mon, 6 May 2013 23:50:11 +0000 (23:50 +0000)
committerArve Hjønnevåg <arve@android.com>
Mon, 1 Jul 2013 22:40:39 +0000 (15:40 -0700)
commit44e77f70f60bdbea4c2b833ae895d6c0357953f4
tree0b2965c12b3e6f674f705e7a6d1c128d58cd183f
parenta57d997d090d0abe8317dca02320ea08bb773e80
freezer: skip waking up tasks with PF_FREEZER_SKIP set

Android goes through suspend/resume very often (every few seconds when
on a busy wifi network with the screen off), and a significant portion
of the energy used to go in and out of suspend is spent in the
freezer.  If a task has called freezer_do_not_count(), don't bother
waking it up.  If it happens to wake up later it will call
freezer_count() and immediately enter the refrigerator.

Combined with patches to convert freezable helpers to use
freezer_do_not_count() and convert common sites where idle userspace
tasks are blocked to use the freezable helpers, this reduces the
time and energy required to suspend and resume.

Change-Id: I6ba019d24273619849af757a413271da3261d7db
Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
kernel/freezer.c