linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] optimize freezing tasks by reducing task wakeups
@ 2013-05-02  1:34 Colin Cross
  2013-05-02  1:34 ` [PATCH v2 01/10] freezer: shorten freezer sleep time using exponential backoff Colin Cross
                   ` (10 more replies)
  0 siblings, 11 replies; 36+ messages in thread
From: Colin Cross @ 2013-05-02  1:34 UTC (permalink / raw)
  To: linux-pm
  Cc: linux-kernel, Rafael J. Wysocki, arve, Tejun Heo, Oleg Nesterov,
	Colin Cross

On slow cpus the large number of task wakeups and context switches
triggered by freezing and thawing tasks can take a significant amount
of cpu time.  This patch series reduces the amount of work done during
freezing tasks by avoiding waking up tasks that are already in a freezable
state.

The first patch reduces the wasted time in try_to_freeze_tasks() by
starting with a 1 ms sleep during the first loop and backing off
up to an 8 ms sleep if all tasks are not frozen.

The second patch modifies the freeze_task() function to skip tasks
that have set the PF_FREEZER_SKIP flag by calling freezer_do_not_count().
These tasks will not enter the refrigerator during the suspend/resume
cycle unless they woken up by something else, in which case they will
enter the refrigerator in freezer_count() before they access any
resources that would not be available in suspend or deadlock with
another freezing/frozen task.

The rest of the series adds a few more freezable helpers and converts the
top call sites that userspace tasks are usually blocked at to freezable
helpers.  The list of call sites was collected on a Nexus 10 (ARM Exynos
5250 SoC), but all the top call sites other than binder show up at the
top of the list on Ubuntu x86-64 as well.

This series cuts the time for freezing tasks from 50 ms to 5 ms when
the cpu speed is locked at its lowest setting (200MHz), and reduces
the number of context switches and restarted syscalls from 1000 to
25.

v2 moves the skip check to freeze_task(), and expands the commit
messages.

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2013-06-25 21:16 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-02  1:34 [PATCH v2 00/10] optimize freezing tasks by reducing task wakeups Colin Cross
2013-05-02  1:34 ` [PATCH v2 01/10] freezer: shorten freezer sleep time using exponential backoff Colin Cross
2013-05-02 23:20   ` Tejun Heo
2013-05-02  1:35 ` [PATCH v2 02/10] freezer: skip waking up tasks with PF_FREEZER_SKIP set Colin Cross
2013-05-02 23:24   ` Tejun Heo
2013-05-03  9:24   ` Pavel Machek
2013-05-02  1:35 ` [PATCH v2 03/10] freezer: add new freezable helpers using freezer_do_not_count() Colin Cross
2013-05-02 23:55   ` Tejun Heo
2013-05-03  0:03     ` Tejun Heo
2013-05-03  2:16       ` Colin Cross
2013-05-03  2:41         ` Colin Cross
2013-05-03  4:09           ` Tejun Heo
2013-05-03  4:12             ` Tejun Heo
2013-05-03  4:17             ` Colin Cross
2013-05-03  4:20               ` Tejun Heo
2013-05-03 14:18             ` Alan Stern
2013-05-03 16:54               ` Tejun Heo
2013-05-02  1:35 ` [PATCH v2 04/10] binder: use freezable blocking calls Colin Cross
2013-05-02  1:35 ` [PATCH v2 05/10] epoll: use freezable blocking call Colin Cross
2013-05-02  1:35 ` [PATCH v2 06/10] select: " Colin Cross
2013-05-02  1:35 ` [PATCH v2 07/10] futex: " Colin Cross
2013-05-02 19:45   ` Thomas Gleixner
2013-05-03  3:12     ` Darren Hart
2013-06-25 21:15   ` [tip:core/locking] futex: Use " tip-bot for Colin Cross
2013-05-02  1:35 ` [PATCH v2 08/10] nanosleep: use " Colin Cross
2013-05-02 19:46   ` Thomas Gleixner
2013-05-02  1:35 ` [PATCH v2 09/10] sigtimedwait: " Colin Cross
2013-05-02  1:35 ` [PATCH v2 10/10] af_unix: use freezable blocking calls in read Colin Cross
2013-05-03  0:08   ` Tejun Heo
2013-05-04 19:19     ` Rafael J. Wysocki
2013-05-04 20:39       ` Tejun Heo
2013-05-04 22:23         ` Colin Cross
2013-05-05 11:23           ` Rafael J. Wysocki
2013-05-02 21:06 ` [PATCH v2 00/10] optimize freezing tasks by reducing task wakeups Rafael J. Wysocki
2013-05-03  0:10   ` Tejun Heo
2013-05-03 11:43     ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).