Re: [PATCH v3 02/16] freezer: add unsafe versions of freezable helpers for CIFS

2013-05-07 Thread Colin Cross
On Tue, May 7, 2013 at 3:07 AM, Jeff Layton wrote: > On Mon, 6 May 2013 16:50:07 -0700 > Colin Cross wrote: > >> CIFS calls wait_event_freezekillable_unsafe with a VFS lock held, >> which is unsafe and will cause lockdep warnings when 6aa9707 >> "lockdep: check t

[PATCH v3 10/16] binder: use freezable blocking calls

2013-05-06 Thread Colin Cross
call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo Signed-off-by: Colin Cross --- drivers/staging/an

[PATCH v3 02/16] freezer: add unsafe versions of freezable helpers for CIFS

2013-05-06 Thread Colin Cross
ll allow problems to be found in other drivers that may have a more serious deadlock risk, and prevent new problems from being added. Signed-off-by: Colin Cross --- include/linux/freezer.h | 13 + 1 file changed, 13 insertions(+) diff --git a/include/linux/freezer.h b/include/l

[PATCH v3 03/16] lockdep: remove task argument from debug_check_no_locks_held

2013-05-06 Thread Colin Cross
by dumping the current stack trace as part of the warning. This was originally part of 6aa9707099c (lockdep: check that no locks held at freeze time) which was reverted in dbf520a9d7d4. Original-author: Mandeep Singh Baines Signed-off-by: Colin Cross --- include/linux/debug_locks.h | 4 ++--

[PATCH v3 04/16] lockdep: check that no locks held at freeze time

2013-05-06 Thread Colin Cross
Cc: Oleg Nesterov Cc: Tejun Heo Cc: Rafael J. Wysocki Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [ccr...@android.com: don't warn if try_to_freeze_unsafe is called] Signed-off-by: Colin Cross --- include/linux/freezer.h | 3 +++ 1 file changed, 3 insertions

[PATCH v3 05/16] freezer: shorten freezer sleep time using exponential backoff

2013-05-06 Thread Colin Cross
All tasks can easily be frozen in under 10 ms, switch to using an initial 1 ms sleep followed by exponential backoff until 8 ms. Also convert the printed time to ms instead of centiseconds. Acked-by: Pavel Machek Acked-by: Tejun Heo Signed-off-by: Colin Cross --- kernel/power/process.c | 26

[PATCH v3 07/16] freezer: convert freezable helpers to freezer_do_not_count()

2013-05-06 Thread Colin Cross
thawing. Signed-off-by: Colin Cross --- v3: split this out of the patch that adds new freezable helpers include/linux/freezer.h | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/include/linux/freezer.h b/include/linux/freezer.h index bcf9e65..c71337af

[PATCH v3 06/16] freezer: skip waking up tasks with PF_FREEZER_SKIP set

2013-05-06 Thread Colin Cross
nergy required to suspend and resume. Acked-by: Tejun Heo Acked-by: Pavel Machek Signed-off-by: Colin Cross --- v2: move check to freeze_task() kernel/freezer.c | 12 1 file changed, 12 insertions(+) diff --git a/kernel/freezer.c b/kernel/freezer.c index c38893b..8b2afc1 100644

[PATCH v3 08/16] freezer: convert freezable helpers to static inline where possible

2013-05-06 Thread Colin Cross
Some of the freezable helpers have to be macros because their condition argument needs to get evaluated every time through the wait loop. Convert the others to static inline to make future changes easier. Signed-off-by: Colin Cross --- include/linux/freezer.h | 58

[PATCH v3 09/16] freezer: add new freezable helpers using freezer_do_not_count()

2013-05-06 Thread Colin Cross
helpers. Signed-off-by: Colin Cross --- v3: split out the changes to existing helpers to a separate patch include/linux/freezer.h | 61 + 1 file changed, 61 insertions(+) diff --git a/include/linux/freezer.h b/include/linux/freezer.h index 8430d4c5

[PATCH v3 12/16] select: use freezable blocking call

2013-05-06 Thread Colin Cross
call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo Signed-off-by: Colin Cross --- fs/select.c | 4 ++

[PATCH v3 11/16] epoll: use freezable blocking call

2013-05-06 Thread Colin Cross
freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo Signed-off-by: Colin Cross --- fs/eventpoll.

[PATCH v3 14/16] nanosleep: use freezable blocking call

2013-05-06 Thread Colin Cross
call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo Acked-by: Thomas Gleixner Signed-off-by: Colin

[PATCH v3 13/16] futex: use freezable blocking call

2013-05-06 Thread Colin Cross
Hart Signed-off-by: Colin Cross --- kernel/futex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/futex.c b/kernel/futex.c index b26dcfc..d710fae 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -61,6 +61,7 @@ #include #include #include +#include #in

[PATCH v2 00/10] optimize freezing tasks by reducing task wakeups

2013-05-06 Thread 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 firs

[PATCH v3 15/16] sigtimedwait: use freezable blocking call

2013-05-06 Thread Colin Cross
freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo Signed-off-by: Colin Cross --- kernel/signal.

[PATCH v3 16/16] af_unix: use freezable blocking calls in read

2013-05-06 Thread Colin Cross
to a freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Acked-by: Tejun Heo Signed-off-by: Colin Cross --- net

[PATCH v3 01/16] freezer: add unsafe versions of freezable helpers for NFS

2013-05-06 Thread Colin Cross
und in other drivers that may have a more serious deadlock risk, and prevent new problems from being added. Acked-by: Pavel Machek Acked-by: Tejun Heo Signed-off-by: Colin Cross --- fs/nfs/inode.c | 2 +- fs/nfs/nfs3proc.c | 2 +- fs/nfs/nfs4proc.c | 4 ++-- include/

Re: [PATCH 1/2] freezer: add unsafe versions of freezable helpers

2013-05-06 Thread Colin Cross
On Mon, May 6, 2013 at 2:58 PM, Linus Torvalds wrote: > On Mon, May 6, 2013 at 2:54 PM, Colin Cross wrote: >>> >>> There are many other possibilities for other codepaths that end up in >>> wait_for_response(). Once we get a solution in place for NFS, we'll &g

Re: [PATCH 1/2] freezer: add unsafe versions of freezable helpers

2013-05-06 Thread Colin Cross
On Mon, May 6, 2013 at 2:43 PM, Jeff Layton wrote: > On Mon, 6 May 2013 12:57:54 -0700 > Colin Cross wrote: > >> On Mon, May 6, 2013 at 3:56 AM, Jeff Layton wrote: >> > On Fri, 3 May 2013 14:04:09 -0700 >> > Colin Cross wrote: >> > >> >>

Re: [PATCH 1/2] freezer: add unsafe versions of freezable helpers

2013-05-06 Thread Colin Cross
On Mon, May 6, 2013 at 3:56 AM, Jeff Layton wrote: > On Fri, 3 May 2013 14:04:09 -0700 > Colin Cross wrote: > >> NFS calls the freezable helpers with locks held, which is unsafe >> and caused lockdep warnings when 6aa9707 "lockdep: check that no >> locks

Re: [PATCH 2/2] lockdep: check that no locks held at freeze time

2013-05-06 Thread Colin Cross
On Mon, May 6, 2013 at 12:01 PM, Tejun Heo wrote: > On Fri, May 03, 2013 at 02:04:10PM -0700, Colin Cross wrote: >> From: Mandeep Singh Baines >> >> We shouldn't try_to_freeze if locks are held. Holding a lock can cause a >> deadlock if the lock is later acqu

Re: [PATCH 2/2] lockdep: check that no locks held at freeze time

2013-05-04 Thread Colin Cross
On Sat, May 4, 2013 at 5:05 PM, Pavel Machek wrote: > Hi! > >> >> >> --- a/kernel/exit.c >> >> >> +++ b/kernel/exit.c >> >> >> @@ -835,7 +835,7 @@ void do_exit(long code) >> >> >> /* >> >> >>* Make sure we are holding no locks: >> >> >>*/ >> >> >> - debug_check_no_locks_h

Re: [PATCH 2/2] lockdep: check that no locks held at freeze time

2013-05-04 Thread Colin Cross
On Sat, May 4, 2013 at 3:57 PM, Pavel Machek wrote: > On Sat 2013-05-04 13:27:23, Colin Cross wrote: >> On Sat, May 4, 2013 at 6:04 AM, Pavel Machek wrote: >> > On Fri 2013-05-03 14:04:10, Colin Cross wrote: >> >> From: Mandeep Singh Baines >> >> >

Re: [PATCH v2 10/10] af_unix: use freezable blocking calls in read

2013-05-04 Thread Colin Cross
On Sat, May 4, 2013 at 1:39 PM, Tejun Heo wrote: > Hello, Rafael. > > On Sat, May 4, 2013 at 12:19 PM, Rafael J. Wysocki wrote: >>> Heh, so you are aware of the deadlock possibilities. Good selection >>> of spots. For all the conversion patches. >>> >>> Acked-by: Tejun Heo >> >> I wonder if t

Re: [PATCH 2/2] lockdep: check that no locks held at freeze time

2013-05-04 Thread Colin Cross
On Sat, May 4, 2013 at 6:04 AM, Pavel Machek wrote: > On Fri 2013-05-03 14:04:10, Colin Cross wrote: >> From: Mandeep Singh Baines >> >> We shouldn't try_to_freeze if locks are held. Holding a lock can cause a >> deadlock if the lock is later acquired in the s

Re: [PATCH 1/2] freezer: add unsafe versions of freezable helpers

2013-05-04 Thread Colin Cross
gt;> Add new *_unsafe versions of the helpers that will not run the >> lockdep test when 6aa9707 is reapplied, and call them from NFS. >> >> Signed-off-by: Colin Cross > > Looks mostly good. > >> @@ -152,6 +169,14 @@ static inline b

[PATCH 1/2] freezer: add unsafe versions of freezable helpers

2013-05-03 Thread Colin Cross
plied, and call them from NFS. Signed-off-by: Colin Cross --- fs/nfs/inode.c | 2 +- fs/nfs/nfs3proc.c | 2 +- fs/nfs/nfs4proc.c | 4 ++-- include/linux/freezer.h | 42 +- net/sunrpc/sched.c | 2 +- 5 files changed, 46 insert

[PATCH 2/2] lockdep: check that no locks held at freeze time

2013-05-03 Thread Colin Cross
Cc: Oleg Nesterov Cc: Tejun Heo Cc: Rafael J. Wysocki Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds [ccr...@android.com: don't warn if try_to_freeze_unsafe is called] Signed-off-by: Colin Cross --- include/linux/debug_locks.h | 4 ++-- include/linux/fre

Re: [PATCH v2 03/10] freezer: add new freezable helpers using freezer_do_not_count()

2013-05-02 Thread Colin Cross
On Thu, May 2, 2013 at 9:09 PM, Tejun Heo wrote: > Hello, > > On Thu, May 02, 2013 at 07:41:39PM -0700, Colin Cross wrote: >> On Thu, May 2, 2013 at 7:16 PM, Colin Cross wrote: >> > This sounds the same as what ended up getting reverted in >> > https://lkml.org

Re: [PATCH v2 03/10] freezer: add new freezable helpers using freezer_do_not_count()

2013-05-02 Thread Colin Cross
On Thu, May 2, 2013 at 7:16 PM, Colin Cross wrote: > This sounds the same as what ended up getting reverted in > https://lkml.org/lkml/2013/3/4/221 > I can add the WARN_ON_ONCE to all my new calls, and leave them out of > existing calls, but that seems a little odd, and will be redund

Re: [PATCH v2 03/10] freezer: add new freezable helpers using freezer_do_not_count()

2013-05-02 Thread Colin Cross
This sounds the same as what ended up getting reverted in https://lkml.org/lkml/2013/3/4/221 I can add the WARN_ON_ONCE to all my new calls, and leave them out of existing calls, but that seems a little odd, and will be redundant if the lockdep call in try_to_freeze goes back in in 3.11. Do you st

Re: [RFC PATCH] power: Add option to log time spent in suspend

2013-05-02 Thread Colin Cross
On Thu, May 2, 2013 at 11:58 AM, John Stultz wrote: > On 05/02/2013 11:29 AM, Colin Cross wrote: >> >> On Thu, May 2, 2013 at 5:27 AM, Pavel Machek wrote: >>> >>> >>>> dmesg is not the solution, it's not a stable api, it would require >&

Re: [RFC PATCH] power: Add option to log time spent in suspend

2013-05-02 Thread Colin Cross
On Thu, May 2, 2013 at 5:27 AM, Pavel Machek wrote: > Hi! > >> >> +#include >> >> +#include >> >> +#include >> >> +#include >> >> +#include >> >> +#include >> >> +#include >> >> + >> >> +static struct timespec suspend_time_before; >> >> +static unsigned int time_in_suspend_bins[32]; >> >> +

Re: [RFC PATCH] drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

2013-05-02 Thread Colin Cross
On Thu, May 2, 2013 at 5:30 AM, Pavel Machek wrote: > Hi! > >> >> > do BUG which >> >> >dumps stack of current task >> >> >kills current task >> >> > >> >> > Current task may very well be idle task; in such case you kill the >> >> > machine. Sounds like you should be doing something else,

Re: [PATCH 03/10] freezer: add new freezable helpers using freezer_do_not_count()

2013-05-02 Thread Colin Cross
On Thu, May 2, 2013 at 5:48 AM, Pavel Machek wrote: > On Mon 2013-04-29 14:45:39, Colin Cross wrote: >> Freezing tasks will wake up almost every userspace task from >> where it is blocking and force it to run until it hits a >> call to try_to_sleep(), generally on the exit

[PATCH v2 00/10] optimize freezing tasks by reducing task wakeups

2013-05-01 Thread 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 firs

[PATCH v2 01/10] freezer: shorten freezer sleep time using exponential backoff

2013-05-01 Thread Colin Cross
All tasks can easily be frozen in under 10 ms, switch to using an initial 1 ms sleep followed by exponential backoff until 8 ms. Also convert the printed time to ms instead of centiseconds. Signed-off-by: Colin Cross --- kernel/power/process.c | 23 +-- 1 file changed, 13

[PATCH v2 07/10] futex: use freezable blocking call

2013-05-01 Thread Colin Cross
call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross --- kernel/futex.c | 3 ++- 1 file chang

[PATCH v2 04/10] binder: use freezable blocking calls

2013-05-01 Thread Colin Cross
call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross --- drivers/staging/android/binder.c | 5 +++

[PATCH v2 06/10] select: use freezable blocking call

2013-05-01 Thread Colin Cross
call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross --- fs/select.c | 4 +++- 1 file chang

[PATCH v2 05/10] epoll: use freezable blocking call

2013-05-01 Thread Colin Cross
freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross --- fs/eventpoll.c | 4 +++- 1 file ch

[PATCH v2 08/10] nanosleep: use freezable blocking call

2013-05-01 Thread Colin Cross
call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross --- kernel/hrtimer.c | 3 ++- 1 file chang

[PATCH v2 03/10] freezer: add new freezable helpers using freezer_do_not_count()

2013-05-01 Thread Colin Cross
(). Additional patches will convert the most common locations that userspace blocks in to use freezable helpers. Signed-off-by: Colin Cross --- include/linux/freezer.h | 72 +++-- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/include/linux

[PATCH v2 10/10] af_unix: use freezable blocking calls in read

2013-05-01 Thread Colin Cross
to a freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross --- net/unix/af_unix.c | 3 +

[PATCH v2 02/10] freezer: skip waking up tasks with PF_FREEZER_SKIP set

2013-05-01 Thread Colin Cross
nergy required to suspend and resume. Signed-off-by: Colin Cross --- v2: move check to freeze_task() kernel/freezer.c | 12 1 file changed, 12 insertions(+) diff --git a/kernel/freezer.c b/kernel/freezer.c index c38893b..8b2afc1 100644 --- a/kernel/freezer.c +++ b/kernel/free

[PATCH v2 09/10] sigtimedwait: use freezable blocking call

2013-05-01 Thread Colin Cross
freezable call because it doesn't hold any locks or release any resources when interrupted that might be needed by another freezing task or a kernel driver during suspend, and is a common site where idle userspace tasks are blocked. Signed-off-by: Colin Cross --- kernel/signal.c | 2 +- 1 file ch

Re: [RFC PATCH] drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

2013-05-01 Thread Colin Cross
On Wed, May 1, 2013 at 3:56 AM, Pavel Machek wrote: > Hi! > >> >> @@ -663,6 +671,30 @@ static bool is_async(struct device *dev) >> >> } >> >> >> >> /** >> >> + * dpm_drv_timeout - Driver suspend / resume watchdog handler >> >> + * @data: struct device which timed out >> >> + * >> >> + *

Re: [RFC PATCH] drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

2013-04-30 Thread Colin Cross
On Tue, Apr 30, 2013 at 9:57 PM, anish singh wrote: > > > > On Wed, May 1, 2013 at 10:09 AM, Colin Cross wrote: >> >> On Tue, Apr 30, 2013 at 9:17 PM, Greg Kroah-Hartman >> wrote: >> > On Tue, Apr 30, 2013 at 08:36:21PM -0700, Colin Cross wrote: >> &

Re: [RFC PATCH] drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

2013-04-30 Thread Colin Cross
On Tue, Apr 30, 2013 at 9:17 PM, Greg Kroah-Hartman wrote: > On Tue, Apr 30, 2013 at 08:36:21PM -0700, Colin Cross wrote: >> On Tue, Apr 30, 2013 at 4:30 PM, Greg Kroah-Hartman >> wrote: >> > On Tue, Apr 30, 2013 at 03:28:33PM -0700, Zoran Markovic wrote:

Re: [RFC PATCH] drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

2013-04-30 Thread Colin Cross
nd time every device, whether or not they >> resumed synchronously. >> >> Cc: Android Kernel Team >> Cc: Colin Cross >> Cc: Todd Poynor >> Cc: San Mehat >> Cc: Benoit Goby >> Cc: John Stultz >> Cc: Pavel Machek >> Cc: Rafael J. Wysoc

Re: [RFC PATCH] drivers: power: Add watchdog timer to catch drivers which lockup during suspend.

2013-04-30 Thread Colin Cross
On Tue, Apr 30, 2013 at 4:30 PM, Greg Kroah-Hartman wrote: > On Tue, Apr 30, 2013 at 03:28:33PM -0700, Zoran Markovic wrote: >> From: Benoit Goby >> >> Below is a patch from android kernel that detects a driver suspend >> lockup and captures dump in the kernel log. Please review and provide >> co

Re: [RFC PATCH] power: Add option to log time spent in suspend

2013-04-30 Thread Colin Cross
On Tue, Apr 30, 2013 at 5:29 PM, Pavel Machek wrote: > Hi! > >> From: Colin Cross >> >> Below is a patch from android kernel that maintains a histogram of >> suspend times. Please review and provide feedback. >> >> Prints the time spent in suspend in

Re: [PATCH 09/10] sigtimedwait: use freezable blocking call

2013-04-30 Thread Colin Cross
On Tue, Apr 30, 2013 at 9:38 AM, Oleg Nesterov wrote: > On 04/29, Colin Cross wrote: >> >> Avoid waking up every thread sleeping in a sigtimedwait call during >> suspend and resume by calling a freezable blocking call. > > This doesn't explain why do want this cha

Re: [PATCH 07/10] futex: use freezable blocking call

2013-04-29 Thread Colin Cross
On Mon, Apr 29, 2013 at 3:52 PM, Darren Hart wrote: > Colin, > > I don't know anything about when or when not to use freezable*, and I > suspect that may be true for others as well. A more complete > description of why it's acceptable here in the commit log might help > expedite acceptance. > Sur

[PATCH 07/10] futex: use freezable blocking call

2013-04-29 Thread Colin Cross
Avoid waking up every thread sleeping in a futex_wait call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- kernel/futex.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/futex.c b/kernel/futex.c index b26dcfc..d710fae

Re: [PATCH 02/10] freezer: skip waking up tasks with PF_FREEZER_SKIP set

2013-04-29 Thread Colin Cross
On Mon, Apr 29, 2013 at 2:57 PM, Tejun Heo wrote: > On Mon, Apr 29, 2013 at 02:51:57PM -0700, Tejun Heo wrote: >> I feel a bit weary of changes which try to optimize state checks for >> freezer because the synchronization rules are kinda fragile and things >> may not work reliably depending on who

[PATCH 04/10] binder: use freezable blocking calls

2013-04-29 Thread Colin Cross
Avoid waking up every thread sleeping in a binder call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- drivers/staging/android/binder.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/binder.c b

[PATCH 10/10] af_unix: use freezable blocking calls in read

2013-04-29 Thread Colin Cross
Avoid waking up every thread sleeping in read call on an AF_UNIX socket during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- net/unix/af_unix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c

[PATCH 08/10] nanosleep: use freezable blocking call

2013-04-29 Thread Colin Cross
Avoid waking up every thread sleeping in a nanosleep call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- kernel/hrtimer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 14be27f

[PATCH 01/10] freezer: shorten freezer sleep time using exponential backoff

2013-04-29 Thread Colin Cross
All tasks can easily be frozen in under 10 ms, switch to using an initial 1 ms sleep followed by exponential backoff until 8 ms. Also convert the printed time to ms instead of centiseconds. Signed-off-by: Colin Cross --- kernel/power/process.c | 23 +-- 1 file changed, 13

[PATCH 05/10] epoll: use freezable blocking call

2013-04-29 Thread Colin Cross
Avoid waking up every thread sleeping in an epoll_wait call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- fs/eventpoll.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/eventpoll.c b/fs/eventpoll.c index 9fec183..65245e7

[PATCH 09/10] sigtimedwait: use freezable blocking call

2013-04-29 Thread Colin Cross
Avoid waking up every thread sleeping in a sigtimedwait call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- kernel/signal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/signal.c b/kernel/signal.c index 598dc06

[PATCH 06/10] select: use freezable blocking call

2013-04-29 Thread Colin Cross
Avoid waking up every thread sleeping in a select call during suspend and resume by calling a freezable blocking call. Signed-off-by: Colin Cross --- fs/select.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/select.c b/fs/select.c index 8c1c96c..6b14dc7 100644 --- a

[PATCH 02/10] freezer: skip waking up tasks with PF_FREEZER_SKIP set

2013-04-29 Thread Colin Cross
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. Signed-off-by: Colin Cross --- kernel/cgroup_freezer.c | 5 - kernel/power/process.c | 4 ++-- 2 files chang

[PATCH 00/10] optimize freezing tasks by reducing task wakeups

2013-04-29 Thread 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 firs

[PATCH 03/10] freezer: add new freezable helpers using freezer_do_not_count()

2013-04-29 Thread Colin Cross
(). Additional patches will convert the most common locations that userspace blocks in to use freezable helpers. Signed-off-by: Colin Cross --- include/linux/freezer.h | 72 +++-- 1 file changed, 58 insertions(+), 14 deletions(-) diff --git a/include/linux

Re: [PATCH] fuse: use kernel headers when __KERNEL__ is set

2013-04-17 Thread Colin Cross
On Wed, Apr 17, 2013 at 2:57 AM, Miklos Szeredi wrote: > On Tue, Apr 16, 2013 at 01:00:37PM -0700, Colin Cross wrote: > >> Every other uapi header includes linux/types.h to get its type >> definitions, and fuse.h should do the same when compiling for >> userspace

Re: [PATCH] fuse: use kernel headers when __KERNEL__ is set

2013-04-16 Thread Colin Cross
On Tue, Apr 16, 2013 at 12:11 PM, Miklos Szeredi wrote: > On Tue, Apr 16, 2013 at 8:29 PM, Colin Cross wrote: >> Dropping __linux__ causes a make headers_check warning, which the >> kbuild test robot reported this morning: >> usr/include/linux/fuse.h:99: found __[us]{8,1

Re: [PATCH] fuse: use kernel headers when __KERNEL__ is set

2013-04-16 Thread Colin Cross
On Tue, Apr 16, 2013 at 11:21 AM, Linus Torvalds wrote: >> What I meant is IF is included by userspace (it sure is >> meant to be included and *is* included by libfuse and other stuff) >> THEN using instead of is fine regardless of >> whether __linux__ is defined or not. > > That's probably tru

Re: [RFC PATCH 1/3] pstore-ram: use write-combine mappings

2013-04-15 Thread Colin Cross
On Mon, Apr 15, 2013 at 4:59 PM, Rob Herring wrote: > On 04/15/2013 05:21 PM, Colin Cross wrote: >> On Wed, Apr 10, 2013 at 6:30 AM, Rob Herring wrote: >>> On 04/09/2013 10:53 PM, Colin Cross wrote: >>>> On Tue, Apr 9, 2013 at 8:08 PM, Rob Herring

Re: [RFC PATCH 1/3] pstore-ram: use write-combine mappings

2013-04-15 Thread Colin Cross
On Wed, Apr 10, 2013 at 6:30 AM, Rob Herring wrote: > On 04/09/2013 10:53 PM, Colin Cross wrote: >> On Tue, Apr 9, 2013 at 8:08 PM, Rob Herring wrote: >>> From: Rob Herring >>> >>> Atomic operations are undefined behavior on ARM for device or strongly &g

Re: [PATCH] fuse: use kernel headers when __KERNEL__ is set

2013-04-15 Thread Colin Cross
On Mon, Apr 15, 2013 at 1:41 PM, Colin Cross wrote: > Commit 7e98d53086d18c877cb44e9065219335184024de (Synchronize fuse > header with one used in library) added #ifdef __linux__ around > defines if it is not set. The kernel build is self-contained and > can be built on non-Linu

[PATCH] fuse: use kernel headers when __KERNEL__ is set

2013-04-15 Thread Colin Cross
try to include stdint.h and fail due to -nostdinc, and then fail with a bunch of undefined type errors. Change the #ifdef to check for __linux__ or __KERNEL__ so that it uses the kernel typedefs if __KERNEL__ is set. Signed-off-by: Colin Cross --- I think this should go in v3.9, without it bare

Re: [RFC PATCH 3/3] pstore/ram: avoid atomic accesses for ioremapped regions

2013-04-09 Thread Colin Cross
On Tue, Apr 9, 2013 at 8:08 PM, Rob Herring wrote: > From: Rob Herring > > For persistent RAM outside of main memory, the memory may have limitations > on supported accesses. For internal RAM on highbank platform exclusive > accesses are not supported and will hang the system. So atomic_cmpxchg >

Re: [RFC PATCH 1/3] pstore-ram: use write-combine mappings

2013-04-09 Thread Colin Cross
Also, isn't this patch unnecessary after patch 3 in this set? > Signed-off-by: Rob Herring > Cc: Anton Vorontsov > Cc: Colin Cross > Cc: Kees Cook > Cc: Tony Luck > Cc: linux-kernel@vger.kernel.org > --- > fs/pstore/ram_core.c |4 ++-- > 1 file changed, 2

Re: [PATCH 1/1] clk: Add notifier support in clk_prepare/clk_unprepare

2013-03-21 Thread Colin Cross
On Thu, Mar 21, 2013 at 3:36 PM, Mike Turquette wrote: > To my knowledge, devfreq performs one task: implements an algorithm > (typically one that loops/polls) and applies this heuristic towards a > dvfs transition. > > It is a policy layer, a high level layer. It should not be used as a > lower-

Re: Fix memory leak in cpufreq stats.

2013-03-11 Thread Colin Cross
On Mon, Oct 15, 2012 at 1:30 PM, Rafael J. Wysocki wrote: > On Monday 15 of October 2012 02:48:28 Tu, Xiaobing wrote: >> >> Fix memory leak in cpufreq stats. >> >> When system enter sleep, non-boot CPUs will be disable. >> Cpufreq stats sysfs is created when the CPU is up, but it is not freed when

Re: [PATCH v5 00/11] per-cgroup cpu-stat

2013-01-23 Thread Colin Cross
On Wed, Jan 23, 2013 at 3:06 PM, Tejun Heo wrote: > Hello, Collin. > > On Wed, Jan 23, 2013 at 02:41:46PM -0800, Colin Cross wrote: >> I think some of it is just historic, we previously did not group >> application threads in the scheduler, so it would cause a change in >

Re: [PATCH v5 00/11] per-cgroup cpu-stat

2013-01-23 Thread Colin Cross
On Wed, Jan 23, 2013 at 8:56 AM, Tejun Heo wrote: > Hello, Collin. > > On Tue, Jan 22, 2013 at 05:53:59PM -0800, Colin Cross wrote: >> I understand why it makes sense from a code perspective to combine cpu >> and cpuacct, but by combining them you are enforcing a strange &

Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-22 Thread Colin Cross
On Mon, Jan 14, 2013 at 4:30 PM, Colin Cross wrote: > On Mon, Jan 14, 2013 at 4:25 PM, Andrew Morton > wrote: >> On Mon, 14 Jan 2013 16:19:23 -0800 >> Colin Cross wrote: >> >>> >> +static void watchdog_check_hardlockup_other_cpu(void) >&

Re: [PATCH v5 00/11] per-cgroup cpu-stat

2013-01-22 Thread Colin Cross
On Tue, Jan 22, 2013 at 5:02 PM, Tejun Heo wrote: > Hello, > > On Mon, Jan 21, 2013 at 04:14:27PM +0400, Glauber Costa wrote: >> > Android userspace is currently using both cpu and cpuacct, and not >> > co-mounting them. They are used for fundamentally different uses such >> > that creating a sin

Re: [PATCH v5 00/11] per-cgroup cpu-stat

2013-01-15 Thread Colin Cross
On Wed, Jan 9, 2013 at 3:45 AM, Glauber Costa wrote: > [ update: I thought I posted this already before leaving for holidays. > However, > now that I am checking for replies, I can't find nor replies nor the > original > mail in my boxes or archives. I am posting again for safety sake, but s

Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-14 Thread Colin Cross
On Mon, Jan 14, 2013 at 6:48 PM, Frederic Weisbecker wrote: > 2013/1/15 Colin Cross : >> On Mon, Jan 14, 2013 at 4:25 PM, Frederic Weisbecker >> wrote: >>> 2013/1/15 Colin Cross : >>>> On Mon, Jan 14, 2013 at 4:13 PM, Frederic Weisbecker >>>>

Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-14 Thread Colin Cross
On Mon, Jan 14, 2013 at 4:25 PM, Frederic Weisbecker wrote: > 2013/1/15 Colin Cross : >> On Mon, Jan 14, 2013 at 4:13 PM, Frederic Weisbecker >> wrote: >>> I believe this is pretty much what the RCU stall detector does >>> already: checks for other CPUs bein

Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-14 Thread Colin Cross
On Mon, Jan 14, 2013 at 4:19 PM, Colin Cross wrote: > On Mon, Jan 14, 2013 at 3:49 PM, Andrew Morton > wrote: >> On Fri, 11 Jan 2013 13:51:48 -0800 >> Colin Cross wrote: >> >>> Emulate NMIs on systems where they are not available by using timer >>> in

Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-14 Thread Colin Cross
On Mon, Jan 14, 2013 at 4:25 PM, Andrew Morton wrote: > On Mon, 14 Jan 2013 16:19:23 -0800 > Colin Cross wrote: > >> >> +static void watchdog_check_hardlockup_other_cpu(void) >> >> +{ >> >> + unsigned int next_cpu; >> >> + >>

Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-14 Thread Colin Cross
On Mon, Jan 14, 2013 at 4:13 PM, Frederic Weisbecker wrote: > 2013/1/11 Colin Cross : >> Emulate NMIs on systems where they are not available by using timer >> interrupts on other cpus. Each cpu will use its softlockup hrtimer >> to check that the next cpu is processing

Re: [PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-14 Thread Colin Cross
On Mon, Jan 14, 2013 at 3:49 PM, Andrew Morton wrote: > On Fri, 11 Jan 2013 13:51:48 -0800 > Colin Cross wrote: > >> Emulate NMIs on systems where they are not available by using timer >> interrupts on other cpus. Each cpu will use its softlockup hrtimer >> to

Re: [RFC][PATCH 0/2] staging: alarm-dev: compat_ioctl support

2013-01-11 Thread Colin Cross
On Fri, Jan 11, 2013 at 1:48 PM, John Stultz wrote: > This is a first-pass at implementing compat_ioctl support for > Android's alarm-dev driver in staging. > > The first patch is some refactoring to cleanup and separate the > copying of user data from the logic, and the second patch adds > the co

[PATCH v2] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-11 Thread Colin Cross
info. Signed-off-by: Colin Cross --- include/linux/nmi.h |5 ++- kernel/watchdog.c | 123 -- lib/Kconfig.debug | 14 +- 3 files changed, 135 insertions(+), 7 deletions(-) Changes since v1: renamed variables to clarify when referring

Re: [PATCH] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-10 Thread Colin Cross
On Thu, Jan 10, 2013 at 9:57 PM, Liu, Chuansheng wrote: > > >> -Original Message- >> From: ccr...@google.com [mailto:ccr...@google.com] On Behalf Of Colin >> Cross >> Sent: Friday, January 11, 2013 1:34 PM >> To: Liu, Chuansheng >> Cc: linux-

Re: [PATCH] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-10 Thread Colin Cross
On Thu, Jan 10, 2013 at 5:39 PM, Liu, Chuansheng wrote: > > >> -Original Message----- >> From: Colin Cross [mailto:ccr...@android.com] >> Sent: Thursday, January 10, 2013 9:58 AM >> To: linux-kernel@vger.kernel.org >> Cc: Andrew Morton; Don Zicku

Re: [PATCH] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-10 Thread Colin Cross
On Thu, Jan 10, 2013 at 12:38 PM, Tony Lindgren wrote: > > * Colin Cross [130109 18:05]: > > +static void watchdog_check_hardlockup_other_cpu(void) > > +{ > > + int cpu; > > + cpumask_t cpus = watchdog_cpus; > > + > > + /* > > +

Re: [PATCH] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-10 Thread Colin Cross
On Thu, Jan 10, 2013 at 6:02 AM, Don Zickus wrote: > On Wed, Jan 09, 2013 at 05:57:39PM -0800, Colin Cross wrote: >> Emulate NMIs on systems where they are not available by using timer >> interrupts on other cpus. Each cpu will use its softlockup hrtimer >> to check

[PATCH] hardlockup: detect hard lockups without NMIs using secondary cpus

2013-01-09 Thread Colin Cross
info. Signed-off-by: Colin Cross --- include/linux/nmi.h |5 ++- kernel/watchdog.c | 98 --- lib/Kconfig.debug | 14 +++- 3 files changed, 110 insertions(+), 7 deletions(-) diff --git a/include/linux/nmi.h b/include/linux/nmi.h index

Re: [PATCH 1/1] cpuidle: coupled: fix ready counter decrement

2012-12-14 Thread Colin Cross
stead of bit-OR. This patch fixes that. > > I'm queuing this up for submission as v3.8 material. > > I suppose it should be marked for -stable too? > > Rafael Acked-by: Colin Cross Looks suitable for stable. >> Signed-off-by: Sivaram Nair >> --- >> drive

Re: [PATCH] cpuidle: coupled: fix the potensial race condition and deadlock

2012-12-14 Thread Colin Cross
On Sun, Dec 2, 2012 at 6:59 PM, Joseph Lo wrote: > Considering the chance that two CPU come into cpuidle_enter_state_coupled at > very close time. The 1st CPU increases the waiting count and the 2nd CPU do > the > same thing right away. The 2nd CPU found the 1st CPU already in waiting then > prep

[PATCH] Revert "Staging: Android alarm: IOCTL command encoding fix"

2012-11-07 Thread Colin Cross
. Cc: stable Cc: Dae S. Kim Signed-off-by: Colin Cross --- drivers/staging/android/android_alarm.h |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/android_alarm.h b/drivers/staging/android/android_alarm.h index f2ffd96..d0cafd6 100644 --- a

Re: [ 044/218] Staging: Android alarm: IOCTL command encoding fix

2012-11-05 Thread Colin Cross
On Mon, Nov 5, 2012 at 12:22 AM, Greg Kroah-Hartman wrote: > On Sat, Nov 03, 2012 at 12:33:07AM -0700, Colin Cross wrote: >> On Fri, Sep 28, 2012 at 1:14 PM, Greg Kroah-Hartman >> wrote: >> > 3.4-stable review patch. If anyone has any object

<    1   2   3   >