diff options
author | Colin Cross <ccross@android.com> | 2013-05-06 23:50:18 +0000 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-08-30 19:33:20 -0700 |
commit | 94d1bad86b9759548dfdfb43785a607e8e2a6f18 (patch) | |
tree | aebf74129efcf1a46db4c9e28eb48268166851da /kernel | |
parent | 0f071d4a49d6064e0c489ea921043af0e7592fe7 (diff) |
futex: use freezable blocking call
Avoid waking up every thread sleeping in a futex_wait call during
suspend and resume by calling a freezable blocking call. Previous
patches modified the freezer to avoid sending wakeups to threads
that are blocked in freezable blocking calls.
This call was selected to be converted 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 <tj@kernel.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 56467c7697f5aef6974501fbe2c3e63674583549)
Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/futex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 49dacfb45745..c3a1a55a5214 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -62,6 +62,7 @@ #include <linux/ptrace.h> #include <linux/sched/rt.h> #include <linux/hugetlb.h> +#include <linux/freezer.h> #include <asm/futex.h> @@ -1808,7 +1809,7 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, * is no timeout, or if it has yet to expire. */ if (!timeout || timeout->task) - schedule(); + freezable_schedule(); } __set_current_state(TASK_RUNNING); } |