netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] optimize freezing tasks by reducing task wakeups
@ 2013-05-06 23:50 Colin Cross
  2013-05-06 23:50 ` [PATCH v3 01/16] freezer: add unsafe versions of freezable helpers for NFS Colin Cross
                   ` (15 more replies)
  0 siblings, 16 replies; 42+ messages in thread
From: Colin Cross @ 2013-05-06 23:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: Pavel Machek, Rafael J. Wysocki, Peter Zijlstra, Ingo Molnar,
	Andrew Morton, Mandeep Singh Baines, Colin Cross, Oleg Nesterov,
	linux-nfs, linux-pm, netdev, Linus Torvalds, Tejun Heo

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 4 patches reintroduce 6aa9707099c (lockdep: check that no locks
held at freeze time) which was reverted in dbf520a9d7d4, and fix up the
known callers with locks held in NFS and CIFS to skip the lockdep check
for now.  The lockdep check will warn any future incorrect users of the
freezable helpers.

The fifth 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 sixth 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.

v3 adds the patches to reintroduce the lockdep check to this patchset,
adds a patch to convert the freezable helpers to static inlines when
possible, and splits the patch that adds the new helpers out of the one
that converts the existing helpers to use freezer_do_not_count.

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

end of thread, other threads:[~2013-07-23 21:58 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-06 23:50 [PATCH v2 00/10] optimize freezing tasks by reducing task wakeups Colin Cross
2013-05-06 23:50 ` [PATCH v3 01/16] freezer: add unsafe versions of freezable helpers for NFS Colin Cross
2013-05-06 23:50 ` [PATCH v3 02/16] freezer: add unsafe versions of freezable helpers for CIFS Colin Cross
2013-05-07 10:07   ` Jeff Layton
     [not found]     ` <20130507060730.03364687-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-05-07 17:47       ` Colin Cross
     [not found]         ` <CAMbhsRQ1i_dFctwjkqjg3=GJdEc8ReEDk=NnEFEXj8u3MaEqDA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-05-07 17:52           ` [PATCH v4 " Colin Cross
     [not found]             ` <1367949125-21809-1-git-send-email-ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
2013-05-07 18:11               ` Jeff Layton
     [not found]   ` <1367884221-20462-3-git-send-email-ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
2013-05-07 12:28     ` [PATCH v3 " Pavel Machek
2013-05-06 23:50 ` [PATCH v3 03/16] lockdep: remove task argument from debug_check_no_locks_held Colin Cross
2013-05-07 12:28   ` Pavel Machek
2013-05-06 23:50 ` [PATCH v3 04/16] lockdep: check that no locks held at freeze time Colin Cross
     [not found]   ` <1367884221-20462-5-git-send-email-ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
2013-05-07 12:29     ` Pavel Machek
     [not found] ` <1367884221-20462-1-git-send-email-ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
2013-05-06 23:50   ` [PATCH v3 05/16] freezer: shorten freezer sleep time using exponential backoff Colin Cross
2013-05-06 23:50   ` [PATCH v3 06/16] freezer: skip waking up tasks with PF_FREEZER_SKIP set Colin Cross
2013-05-06 23:50 ` [PATCH v3 07/16] freezer: convert freezable helpers to freezer_do_not_count() Colin Cross
2013-05-06 23:50 ` [PATCH v3 08/16] freezer: convert freezable helpers to static inline where possible Colin Cross
2013-05-06 23:50 ` [PATCH v3 09/16] freezer: add new freezable helpers using freezer_do_not_count() Colin Cross
2013-05-06 23:50 ` [PATCH v3 10/16] binder: use freezable blocking calls Colin Cross
2013-05-06 23:50 ` [PATCH v3 11/16] epoll: use freezable blocking call Colin Cross
2013-05-06 23:50 ` [PATCH v3 12/16] select: " Colin Cross
2013-05-06 23:50 ` [PATCH v3 13/16] futex: " Colin Cross
2013-07-22 23:02   ` 3.11-rc regression bisected: s2disk does not work (was Re: [PATCH v3 13/16] futex: use freezable blocking call) Michael Leun
2013-07-22 23:55     ` Colin Cross
2013-07-23  0:32       ` Linus Torvalds
     [not found]         ` <CA+55aFzUVPJe96z8V0F-znc8ZcpJid7LEeYww80M-Mx=S91tAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-23  0:42           ` Colin Cross
     [not found]             ` <CAMbhsRReF9xB597i9CcCj7D1P5kvB4cc0JmDQYeboqi11Kp99A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-23  1:41               ` Rafael J. Wysocki
     [not found]                 ` <15305281.aClQ8XUG9t-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2013-07-23  6:28                   ` Colin Cross
2013-07-23 20:31                     ` Colin Cross
2013-07-23 21:58                       ` Michael Leun
2013-07-23 18:08       ` Michael Leun
2013-07-23 18:24         ` Darren Hart
2013-07-23 18:29         ` Colin Cross
2013-07-23 19:16           ` Michael Leun
     [not found]             ` <20130723211622.50f75087-gjVD6BTPoEbYa4IuQwzu8g@public.gmane.org>
2013-07-23 19:29               ` Colin Cross
     [not found]                 ` <CAMbhsRQU=TswYg-2WqHmzt-_GpfMFpYHPSU4eFd5XMw7DRGXJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-23 19:58                   ` Michael Leun
     [not found]           ` <CAMbhsRT6zOKLhG_uh=nA8H_3d7afhG+4jvWjvidY3fEguryP_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-23 21:43             ` Rafael J. Wysocki
     [not found]     ` <20130723010250.5a3465ec-gjVD6BTPoEbYa4IuQwzu8g@public.gmane.org>
2013-07-23  0:26       ` Pavel Machek
2013-05-06 23:50 ` [PATCH v3 14/16] nanosleep: use freezable blocking call Colin Cross
2013-05-06 23:50 ` [PATCH v3 15/16] sigtimedwait: " Colin Cross
2013-05-06 23:50 ` [PATCH v3 16/16] af_unix: use freezable blocking calls in read Colin Cross
2013-05-07 18:12 ` [PATCH v2 00/10] optimize freezing tasks by reducing task wakeups Tejun Heo
2013-05-08  0:02   ` 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).